Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anybody know how? help button with green arrow on top of screen.

Status
Not open for further replies.

lulo

Programmer
Jan 24, 2001
51
US
I've seen very nice application been developed with a help button next to the minimize button.
When you pass the mouse on top of it, the arrow turns green.
It will be nice if I new how to do that on vb.


Does anybody knows how?

Your tips are greatly appreciated.

Lulo
 
well, I would do this in the following manner:

Create two icons or .bmp graphics, one where the arrow turns green, and one for the standard arrow.

You can then place these graphics in a picturebox and set the picturebox to transparent, no border, etc., so that only the image of the arrow is visible.

all you need to do next is place the picture box next to the minimize button (or even on top of it, however you want) using the move command:

Picture1.Move Me.Left + me.Width - 20, 0

Note: change 20 to whatever distance you want it from the right side of the form. also, change 0 to adjust how far you want it from the top edge of the form.

The only thing left is to chenge the image when your mouse goes over the minimize button.

You can do this very easily utilizing the FAQ I wrote (in the FAQ section under "Images, etc." to create rollover images. All you need to watch for there is not to use the coordinates of the image, but determine the coordinates of the minimize button instead.

Hope this helps. Let me know if you need more detailed instructions. Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
It didn't work. The picture hides under when move top -50, it never stay on top.
But thank you very much for your time.
I appreciate it.

Lulo
 
does your image hide behind the button, or does it go behind the whole form?

another way would be to disable the buttons on the top altogether and manually program images to act in the stead of the buttons. i believe the buttons can be disabled in the form properties window. Best Regards and many Thanks!
Michael G. Bronner X-)

"They who drink beer will think beer." Washington Irving
 
It is unfortunately not quite that simple.

The problem here is that, in general, VB's controls can only be displayed within the client area of their parent form. Things like the title bar are OUTSIDE of the client area, known as the nonclient area

So you need to figure draw in the nonclient area AND to receive mouse messages from it. Whilst there are probably several ways to do this, the 'easiest' is to use the Addressof operator to subclass the form you want to do this in, and intercept and act on at least two messages:

WM_NCPAINT and
WM_NCMOUSEMOVE
 
I've got working code that demonstrates this, if you are interested.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top