Hi!! is there any way in C# n visual stdio 2005 that we can...........  
Author Message
syhzaidi





PostPosted: Windows Forms General, Hi!! is there any way in C# n visual stdio 2005 that we can........... Top

Hi!! is there any way in C# n visual stdio 2005 that we can...........

i want to replace the conventional look of windows forms to a bitmap customize look of my software......there fore is there any way that i can load a bitmap...and on that bitmap i load the "-" "x" the minimize buttons and cancels in a superb look......i hope u understand what i want.....again.....i want to replace the form look through a bitmap...and on that bitmap i want to paste button and take work of forms through it

thank u.//




Windows Forms4  
 
 
syhzaidi





PostPosted: Windows Forms General, Hi!! is there any way in C# n visual stdio 2005 that we can........... Top

hi...well plz tell me any good tutorials...and something that i can do it.....if there is a way it.....as i m beginer in C#..

 
 
Peter Ritchie





PostPosted: Windows Forms General, Hi!! is there any way in C# n visual stdio 2005 that we can........... Top

In Windows you can override the painting of a window's non-client area (the title bar, close/minimize/maximize buttons, border). .NET doesn't directly support this. You'd have to manually process windows messages like WM_NCPAINT. If all you're trying to do is make a custom look to your window, I suggest just disabling the caption bar for your form, use the Form.BackgroundImage property and the Button.BackgroundImage property to create a bitmap background and buttons that appear how ever you want for you minimize/maximize/close buttons.

 
 
Alan Robbins





PostPosted: Windows Forms General, Hi!! is there any way in C# n visual stdio 2005 that we can........... Top

You can do absolutely anything you can dream of in c# or vb.net -- it's just a matter of how much work you want to put into it!

Set the form's border style property to None; this gives you a borderless container. Then, set the background image to the bitmap you want. At this point you can do one of two things: Put a button on the form and make it look like the control box (the upper left min/max/close)... or if you want part of the picture to act like the control box put code in the form's mouse click event to determine if they clicked on the picture.

For the second approach there are some nice built in functions to make this easier.

In Mouse click e.X and e.Y are screen coordinates (relative to the screen). If you call PointToClient() you'll get the coordinates relative to the upper left corner of the form which is easier to work with. If you know the rectangle's coordiantes that bound the part of the picture, there is a rectangle.contains(point) function.

HTH