VBA userforms - vis...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] VBA userforms - visible/hidden controls with mouse hover

4 Posts
2 Users
0 Reactions
75 Views
Posts: 1103
Free Member
Topic starter
 

I've managed to create a userform that has buttons (images really) that change colour if mouse scrolls over them. I've also done one button (image really) which only appears if the correct combination of option buttons are selecte followed by pressing a calculate button.

How does one apply the same mouse scroll thing to that button? I can get the button to appear but not change colour if scrolled over.

The two images which overlay to create the on/off appearance of that button are set to invisible until the aforementioned option button combination is correct.

Do I have to do something like if button visible then apply the mouse hover bit to alternate between the on/off images?

Apologies for the niche and probably confusing message. Any help gratefully received.


 
Posted : 09/03/2020 8:13 pm
Posts: 13594
Free Member
 

I’ve managed to create a userform that has buttons (images really) that change colour if mouse scrolls over them.

How are you doing that?

Curious VBA fanboy..

Do I have to do something like if button visible then apply the mouse hover bit to alternate between the on/off images?

Generally, with forms, I have a bit in the set up functions which sets up the properties of each item depending on what I'm showing the particular user, so some things might be disabled or hidden entirely; or number boxes with different background colours if I want to draw attention to something etc.


 
Posted : 09/03/2020 8:29 pm
Posts: 1103
Free Member
Topic starter
 

I created two bitmap images of the button with one being like a negative. I then insert these into the picture field of separate image frames and then lay these ontop of eachother before going into the code to do a visible true or false for a mouse move action.


 
Posted : 09/03/2020 9:13 pm
Posts: 13594
Free Member
 

Are you having to detect the mouse position relative to your image, or is VBA doing that for you?


 
Posted : 09/03/2020 9:18 pm
Posts: 1103
Free Member
Topic starter
 

Are you having to detect the mouse position relative to your image, or is VBA doing that?

I'm not sure tbh. I've not programmed anything specific re positions if that helps?


 
Posted : 09/03/2020 11:30 pm

6 DAYS LEFT
We are currently at 95% of our target!