Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# buttons programming , +
hi all ,
 
i have a win form , i want its close button placement on right side of the win form like widgets.
to close the widget we press the close button on the right side of the widget . it is placed parallel panel with widget. like windows 7 widgets.
 
now how can i do same with widows form.
 
is it possible?
Posted 20-Feb-13 21:52pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can't move or easily change the standard window components, such as the close button - I think the only way you are going to be able to do that is to remove the standard components and emulate them in your own code.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

on the form > formborderstyle select none> then create a button that you like then position it
then the code behind is either this.Close(); or Application.Exit();
  Permalink  
Comments
syedaliaizazuddin at 21-Feb-13 3:27am
   
how can i place it to parrallel to its wall?
syedaliaizazuddin at 21-Feb-13 4:36am
   
@jenicamae how can i stik that button out side the forms?
like widgets have outside panl in right hand side and it is stik o its wall...
jenicamae at 21-Feb-13 20:59pm
   
@syedaliaizazuddin http://www.squidoo.com/irregular-shaped-windows-form-transparency
you need to make the side of the form transparent and you can place the button on the transparent portion of the form that makes it like it is in the outside part of the form
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hide the default Widget button and make a labellink as 'X' and onClick Event code will be 'this.close'.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100