05 November 2007
.net Additive versions
29 October 2007
Visor de riesgo para Facturaplus
25 October 2007
AI has simmetry?
Does anyone know why is simmetrical? I take the steps from the Barber's article and well it's a curious picture.
18 October 2007
Spry - Customize the MenuBar
Result:
How to:
1.- First of all add a MenuBar from the Insert toolbox-Spry
2.- After you add the MenuBar in the webpage, I remove the text and assign for each link a custom id:
3.- And now in a css file (linked to this), I customize simply to this:
Might be for dummies, but sometimes trying things we do it by the complex way.
23 July 2007
WPF Moving Controls in XYZ
To do that, in the xaml file add to the button:
button keydown="OnKey" previewmousemove="OnMove"
And in the .cs add the next methods:
public void OnMove(object o, MouseEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
b = (Button)o;
SetZ();
Canvas.SetZIndex(b, 99);
b.Margin = new Thickness(e.MouseDevice.GetPosition(null).X - b.Width / 2, e.MouseDevice.GetPosition(null).Y - b.Height/2, b.Margin.Right, b.Margin.Bottom);
}
}
and for using the keyboard:
public void OnKey(object o, KeyEventArgs e)
{
int delta = 20;
b = (Button)o;
SetZ();
Canvas.SetZIndex(b, 99);
switch (e.Key)
{
case Key.W:
b.Margin = new Thickness(b.Margin.Left, b.Margin.Top - delta, b.Margin.Right, b.Margin.Bottom);
break;
case Key.S:
b.Margin = new Thickness(b.Margin.Left, b.Margin.Top + delta, b.Margin.Right, b.Margin.Bottom);
break;
case Key.A:
b.Margin = new Thickness(b.Margin.Left - delta, b.Margin.Top, b.Margin.Right, b.Margin.Bottom);
break;
case Key.D:
b.Margin = new Thickness(b.Margin.Left + delta, b.Margin.Top, b.Margin.Right, b.Margin.Bottom);
break;
default:
break;
}
}
Apparently is easy, the matter about all of this, is that there's only few docs, so I hope you find this useful and encourage you to improve your apps (uis).
17 July 2007
Focusing (graphically talking) controls
using System.Windows.Media.Effects;
using System.Windows.Threading;
using System.Windows.Input;
...
BlurBitmapEffect blur;
Button b;
System.Timers.Timer t_1;
public void AutoFocus(object o, EventArgs e)
{
b = (Button)o;
blur = new BlurBitmapEffect();
b.BitmapEffect = blur;
blur.Radius=5;
t_1 = new System.Timers.Timer(1);
t_1.Elapsed +=new System.Timers.ElapsedEventHandler(OnTime);
t_1.Start();
}
...
void OnTime(object sender, System.Timers.ElapsedEventArgs e)
{
this.Dispatcher.Invoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate
{
if (blur.Radius > 0)
blur.Radius--;
else
t_1.Stop();
return null;
}), null);
}
...
public void AutoDifuse(object o, EventArgs e)
{
BlurBitmapEffect blur = new BlurBitmapEffect();
blur.Radius = 5;
((Button)o).BitmapEffect = blur;
}
...
The code is easy to understand, the only matter is the strange way to use a Timer, because if you try to ommit the Dispatcher.Invoke you will have threading problems. The rest I think is easy to understand. Tomorrow I'll show you how to move controls on runtime
13 July 2007
Solved the GridView Header
The codeproject comment with the code is here
I hope you find it useful or a year of this decade (when you decide to use WPF)
22 June 2007
La nueva WPF GridView
Espero que sea de utilidad sino ahora dentro de unos meses, Saludos Juanpa
19 June 2007
The new WPF GridView customized 1 of 3
Until the next article, bye.
15 June 2007
The GridView (WPF)
Today I was in the Step 3 of codeproject to upload my new article about GridView and when I click on Next it crush :(. All my translated article to the net bin. So tonight I will upload it again, (I'll copy the html), for the spanish readers here is the .pdf file of my article send me an email to receive a .pdf version
This is the first chapter of two, it contains:
- Creating a GridView
- Binding XML .net 2.0
- Binding XML with XAML only (static)
- Binding XML with XAML and C# (dynamic)
- Binding SQL Server Data.
- Binding Access Data.
- Binding MySQL Data.
- Customize Header.
- Customize Background.
- Customize Rows.
In the next chapter I will add binding array, editing cells, grouping and more customization.
03 June 2007
New article and updates
I have updated the RibbonMenuButton with Solved Repaint ChangingSize, solved excesive CPU consuming. Added KeepPress and IsPress functionaliy, I hope CodeProject post it on Monday.
Thank you very much for the votings and comments . Now I have to rest a bit.
30 May 2007
Tutorial: Custom XAML Button - First Step
1.- Download Microsoft Expression Design : This is needed to learn a bit of XAML figure structure and design easily , (at the moment I'm solving a problem with a domain when I finished it I'll put all my code files, if you want the source, email me: mailto:juanpablogc@gmail.com , subject: Overrider_300507)
Paint something that you would like to have in a button, (I take a similar look and feel as my RibbonRoundButton).
After you have finished it, you will have to export it to a xaml file. The structure of an xaml (the interesting part for us) is for instance:
canvas...>
ellipse...>
/ellipse>
path...>
/path>
path...>
/path>
/canvas>
(I have problems to add (<) in the blog)
You can imagine the Canvas as a Drawing Table where you layout the components and inside you can add everything you want as Ellipses, Paths... (This substitutes to the OnPaint method which disappears in .net 3.5)
2.- After you have get customed a bit with designer, and exported the file, you must take advice that every component in designer has a name like:
x:Name="Layer_1...
x:Name="Ellipse_0"...
x:Name="Path"...
you must remove the part of x:Name... because a control in Orcas can have only one name.
and to work fine in Orcas, and change Canvas to Grid.
Tomorrow I'll show you how to implement it in a Control Button, as a preview take a look to this screenshot:
29 May 2007
Hello World Orcas
If you have any problem post me a comment, to tell you how to solve it. And now... Hello World Orcas:
1.- Create a new WPF application
1.1- Go to Project : HelloWorld properties and change the next:
2.- Add a button on the window
3.- Let's create the event (I supposed they will put a design mode early), to do that, go to the window.xaml.cs (yeah we will have to get customed):
4.- And now add the following code:
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
button1.Click += new RoutedEventHandler(button1_Click);
}
void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("Hello World");
}
}
Run and you will have your first VISTA WPF .net 3.5 C# first app, Congratulations :)
28 May 2007
Preparing RibbonFastMenu
RibbonMenuButtons and RibbonContextMenu,
as you can see in the image, I also included the Transparent Region to place the RibbonForm in the correct place. The constructor will have the
RibbonRoundButton location to place it well.
When you click on the Arrow Region of a button with SplitRegion, you open the RibbonContextMenu (second image). I solved some matters with the round corners and the shadow which was difficult because I haven't found any help about this matter in the Internet but at the end I get it.
RibbonContextMenu, and the Gradients of the RibbonFastMenu.
After that I'll mix with the RibbonForm.
RibbonMenuButton is the Keep Pressed option, that makes the chance to keep it pressed and send to the Parent Control (Container) to the other RibbonMenuButtons to left this Status. (It will be great to simulate tabcontrols with RibbonMenuButtons or any multichoice selection.
24 May 2007
Preparing the RibbonForm
- RibbonCommandButtons (Minimize, Maximize and Close).
- Method to change Hue, Sat and Brightness
- Secondary title with armony ForeColor
- I'm including the RibbonRoundButton (it looks great)
- I have to make all the methods to resize and move the RibbonForm.
I'm finishing the RibbonFastMenu with the RibbonContextMenu. I think this weekend or next I'll publish the article.
The down count is coming to integrate and create a great library. Thanks everyone
19 May 2007
The RibbonRoundButton
I'll publish it in codeproject with the RibbonForm and the Updated RibbonMenuButton with the InfoForm and ContextMenuStrip.
It was difficult to add a shadow under the circle region but at the end I think it finished well.
Another matters with that is the stranges halos that has inside and over, in a few days you will have all the code.
11 May 2007
About RibbonMenuButton
Due to my ControlLibrary is getting huge, I thought explain it as I finished the parts, and then publish it as article in codeproject. Here is a screenshot of the RibbonMenuButtonControlTest.
The interesting properties I created are:
- Arrow: ToRight or ToDown.
- ColorBase,ColorOn,ColorPress (not more back images, more customizable).
- GroupPos: Left,Center,Right,Top,Bottom.
- ImageLocation : L,R,C,T,B.
- ImageOffset (Autoscales).
- Radius (of corners button).
- ShowBase: to show base or not.
- SplitButton: to convert in multiple click event.
- Split Distance : to set the size of the contextmenu button part.
- FadingSpeed: how fast is the transtition from base to oncolor and back.
I have to add the final touches and if you want to add another functionality, tell me, I'll be grateful to know your opinion and I'll try to add it.
If you want to learn with this controls, I recommend you to take a look to:
- this.Region: thats a good way to avoid matters of transparency.
- LinearGradient with multiple colors, that makes easy the gradients.
- MeasureString : thats a good method to position the text (Beacuse you have to take away the base.OnPaint -> you have to do ALL, including write the text).
- Transform Colors Method including Alpha opacity.
- The DrawArc Method: As you can see with the radius you can make smooth corners
- OnMouseUp: Here you can see what happens when the is SplitButton is activated.
Tomorrow or next, you will see the fantastic RibbonRoundButton. (Another thing, I'm Spanish and I want to improve my English. Could you tell me my faults in the articles? Thank's)