c# - windows form controlbox

M

mohit.akl

Hey guys & gals

I am havng trouble modifying the control box. I want to make the
maximise button invisible and have minimisise button instead of it.
Like this _ X (not like _ o X )

How to do this... and eventually i want to modify the control box in
the form of ? _ X ... I.e. adding a new button to control box. I need
to detect the click events.

Please help
 
S

simida

i don't know about your control box. Is it a form ?
if it's a form, you can set Form 's property MaximizeBox or
FormBorderStyle.

Sincerely,
simida

(e-mail address removed) 写é“:
 
M

mohit.akl

Yes it is the control box on the form and i want to take the maximise
button out. thing is when I disable it from settings then it is
disabled and still visible. I don't want it to be visible and need a ?
button there... plz help...any1... i know someone has done this for
sure...
 
M

mohit.akl

The problem not resolved yet ??? !!!

Yes it is the control box on the form and i want to take the maximise
button out. thing is when I disable it from settings then it is
disabled and still visible. I don't want it to be visible and need a ?
button there... plz help...any1... i know someone has done this for
sure...
 
D

Dave Sexton

Hi Simida,

The control box is the right-most button on the title bar of your Form. It is not the entire title bar.

You can get a "?" button, called a help button, to appear on your Form without creating your own. To show the help button you must
disable both maximize and minimize buttons and set the Form's HelpButton property to true.

I suggest that you leave the functionality as is because that's what is normal to Windows users . In other words, trying to leave
the minimize button while showing the help button is going to be difficult and provide a strange user experience. It is common for
the help button to appear on modal dialogs, which usually can't be resized at all. If you want to provide help to a non-dialog Form
you could still use the HelpProvider class by adding "?" links near your controls and calling the methods programmatically.

If you really need to simultaneously display a minimize button and a help button you could remove the border chrome of the Form
completely and paint your own border chrome with a title bar. Then you can add as many buttons as you'd like, but you'll lose the
system menu, which is the left-most dropdown list although technically that could be recreated.
 
M

mohit.akl

Thanks Dave for the reply,
Unfortunately I am not able to find help regarding the border chrome
for windows form. I think I forgot to mention its for windows form.
Will it make any difference? For my GUI is want the user to see the
control box in that form so i don't have any other option :( Could you
please tell me about some tutorial or some code where this has been
implemented.

Thanks alot
mohit
 
D

Dave Sexton

Hi mohit,

This is not something that is normally required when designing a Windows GUI so I don't have any links to which I can refer you.
It's probably not worth the effort, but you can remove the border chrome of your System.Windows.Forms.Form class by setting the
FormBorderStyle property to FormBorderStyle.None.

You can just Dock a Panel control to the top of the Form and add as many buttons as you'd like in the Panel. Set the
BackgroundImage of the Panel to a custom image if you want the Form to appear as if it has a border, but realize that this is not
functionally equivalent to actually having a border. You'd have to go a step father by handling mouse events and using Interop to
create an actual border. An Image of a border should probably suit your needs just fine.

You can also set the TransparencyKey of your Form to any Color that you'd like, after which when that Color appears anywhere on the
Form or in it's child controls the Color is rendered as transparent by Windows so that the underlying desktop will show through.
This will allow you to reshape your Form as you see fit by setting the BackgroundImage of the Form to a custom Image that makes use
of the TransparencyKey Color that you have selected.

GL
 
M

mohit.akl

Thanks alot for your feed back. I have decided to keep it simple. Not
using that fancy option which i wanted to use. But i do not want the
user to have a option of maximised. Is there any way to remove the
maximise button. As I am able disable it but not able to make it
invisible. Any dieas
Mohit
 
M

mohit.akl

Thanks Dave. there goes another idea out of window... lol... thanks
alot... I might stick to regular stuff... as more coding means more
documentation...lol... thanks alot for ur help... u been of gr8 help...
Regards
Mohit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top