Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Add button to title bar using VB.NET

Posted on 2003-11-27
11
Medium Priority
?
1,235 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 18

Accepted Solution

by:
testn earned 375 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

647 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