Add button to title bar using VB.NET

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?
LVL 2
HappyParrotAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HappyParrotAuthor Commented:
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
HappyParrotAuthor Commented:
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
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

HappyParrotAuthor Commented:
I've incresed the value of the question to 250 pts.
0
Mikal613Commented:
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
HappyParrotAuthor Commented:
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
nhuanvnCommented:
So why don't you put a label with a background color depending on window's theme ?
0
HappyParrotAuthor Commented:
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
HappyParrotAuthor Commented:
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
HappyParrotAuthor Commented:
I'll award [b]testn[/b] with the original 125 pts. for the partial answer
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.