Re: Slider Bar for Survey

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: GraemeR (graeme_at_wave_nospam.co.nz)
Date: 01/27/05


Date: Thu, 27 Jan 2005 22:43:15 +1300

Hi Jim, there are third party controls for this e.g. Microsoft Slider
Control that you may have installed on your system. I think it's part of VB.

To create the whole thing in MS Access I would place a label and a couple of
lines on a form.
Place a horizontal line on the form and set it's style to Chiseled. This
will be your slider.
Place a label (named lblBackground) over the line (background
transparent)Make it tall enough to easily catch the MouseDown and MouseMove
events (a line isn't tall enough.)
Place a space in the Label so that MS Access doesn't delete the control on
exiting it.
Place a short vertical line on the form (called linMarker) to mark where the
user clicked.

To indicate where a user clicked on the slider

Private Sub lblBackground_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)

    linMarker.Left = lblBackground.Left + X
    linMarker.Width = 0

End Sub

Obviously you can trap the MouseMove event to add some flare.
Also, use something a little more creative than a vertical line for the
marker.
Cheers, Graeme.



Relevant Pages

  • Re: how to have a checkbox change color and text of a label control?
    ... So could you make the label control box change color instead of the font? ... states "Private Sub Form_Current is highlighted yellow ... Name the checkbox and the label with similar names. ...
    (microsoft.public.access.forms)
  • Re: Reversing changes made by mousemove event
    ... I have a label control so this is how I ... It doesn't work with the control array of labels. ... Private Sub Label2_DragDrop(Index As Integer, Source As Control, X As ... Label2.Drag vbEndDrag ...
    (microsoft.public.vb.general.discussion)
  • Re: Reversing changes made by mousemove event
    ... like you are saying that your modified code doesn't work with the control ... Private Sub Label2_DragDrop(Index As Integer, Source As Control, X As ... Label2.Drag vbEndDrag ... to another label without going over the image control. ...
    (microsoft.public.vb.general.discussion)
  • Re: re-use of code in a module ...
    ... First thing you need to know is that a label which is attached to a control ... Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As ...
    (microsoft.public.access.formscoding)
  • Re: Highlight Button...
    ... > controls from the Control Tollbox toolbar and exploit the ... > 1) Right-click the label. ... > Private Sub Label1_MouseMove(ByVal Button As Integer, ...
    (microsoft.public.excel.programming)