[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1239
  • Last Modified:

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?
0
HappyParrot
Asked:
HappyParrot
1 Solution
 
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now