Show only minimize button

D

dbcuser

I am writing a tray program. I want to enable only the minimize button
both maximize and close button to disabled. How can I do that?

I tried disabling the control box and maximize button then all 3
buttons disappeared. If I enable control box alone, then I get my
minimise button but that make the close button also enabled. Is there a
way only to show the minimise button ??? I am using C# 2.0 VS2005.

Thanks.
 
B

Bojan Mijuskovic

I am writing a tray program. I want to enable only the minimize button
both maximize and close button to disabled. How can I do that?

AFAIK, there's no way to do it from the designer. You may try to P/Invoke
(WinAPI) and send the message to your window to enable/disable or show/hide
buttons.

Another suggestion would be much easier to implement, it's just about how
you want your tray app to behave. You could leave only Close button
visible, handle FormClosing event and from there minimize (or really close)
the app as per user's preference (an option called "Close to tray" for
example).


Regards,
Bojan Mijuskovic [MVP]
 
D

dbcuser

I agree, my solution is also the second one. But I thought someone
might come across this issue to solve it nicely. I will go back to your
second suggestion.
 

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