Solved

Add button to title bar using VB.NET

Posted on 2003-11-27
11
1,214 Views
Last Modified: 2010-05-18
I'm programming using VB.NET and I want to add a minimize button to the title bar of my toolbox styled window. Ideas anyone?
0
Comment
Question by:HappyParrot
11 Comments
 
LVL 18

Accepted Solution

by:
testn earned 125 total points
ID: 9831360
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9831935
tnx, but thas is good for drawing up there... what I need is to place a window control and bind it to onClick event (well the binding part I can manage with the Addhandler, but the placing part is much more problematic for me)
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9832344
I've found a way to draw the button it self up there in the title bar using the API function DrawFrameControl, the problem with function is that I lose all the window theming like rounded borders and colored buttons, the good thing is that I can set the function to draw any system button I want (minimize, close ets...) May be there is a newer version of that function? Please ,somebody, give me a hint here...
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9832348
I've incresed the value of the question to 250 pts.
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 9833640
i know its ugly but in my app i just made a label on the upper right corner of the form (under the toolbar) and did WindowState = VBMinimimized by the click event
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:HappyParrot
ID: 9834011
I thought of it already and also about placing a bitmap and changing it in response to mouseover, mouseout, ets... I'll have problem here if user uses a different theme for his window that the standard blue one - it will look really agly :/
0
 
LVL 1

Expert Comment

by:nhuanvn
ID: 9837307
So why don't you put a label with a background color depending on window's theme ?
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9837335
I could simply draw a white rectangle with rounded corners using the drawregion method and then draw the small line, but then I will need to apply masks to show the mouseover state and mousedown state, but I want it to look like a XP button... so it won't work... Have you seen Photoshop toolbox windows? This is the effect I'm looking for.
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9843187
Ok, I ended up creating my own class for that minimize button, handlling all it's draw events and using overloaded version of WndProc to respond to all the possible user input on that button (mouseover, mousedown ets)... At least I have now a class I can reuse and basicaly create any button I want in XP style.
All the drawing done in GDI+ with no bitmaps, for speed.
0
 
LVL 2

Author Comment

by:HappyParrot
ID: 9843202
I'll award [b]testn[/b] with the original 125 pts. for the partial answer
Thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now