Slider bar

D

Dale Fye

I just had a client ask if I could add a slider bar next to a textbox, so I
added the MSComctlLib.Slider.2 control to my form.

Interestingly, this slider does not have a control source, so I have to set
its value programmatically. And since it is not bound, it doesn't have
Before and After Update events, so I have to use the Exit event to change the
value of the textbox, which is kind of awkward, since the value in the text
box doesn't change until the user goes to another control on the form.

Does anyone know of a bound slider control I could use?
 
B

Bill

Dale,

I had this situation come up in the past. What I did to get
around the problem you describe is to superimpose the
text box on top of a combo and control the behavior of
the combo in code. That way, when combo events occur
I could easily control the contents of the un-bound text
box. It's easy to toggle visibility as required and align the
controls such that one can't tell there's superimposition.

Hope this helps.

Bill
 
D

Dale Fye

Bill,

I just figured this out.

Although the slider control only contains 5 events in the properties window
of the form designer, if you go to the VB Editor, select the control in the
dropdown and then expand the events, there is a Change event which I can use
to accomplish what I was doing in the sliders Exit event. This is cleaner,
but still not nearly as good as if you could bind the control to a field.
 
B

Bill

Ah yes, I like that better.
Bill


Dale Fye said:
Bill,

I just figured this out.

Although the slider control only contains 5 events in the properties
window
of the form designer, if you go to the VB Editor, select the control in
the
dropdown and then expand the events, there is a Change event which I can
use
to accomplish what I was doing in the sliders Exit event. This is
cleaner,
but still not nearly as good as if you could bind the control to a field.
 
D

Dale Fye

By quirk, do you mean the visibility of only a few of the events in the
properties window?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top