Can I hide ToolTipText for the slider bar?

In VBA programming, can I hide ToolTipText for the slider bar?

The figure below shows the slider bar in a form in a Microsoft Access database. I would like to hide ToolTipText in a red circle.

The reason I want to do this is because the slider bar cannot display decimal values ​​(example: 0.1), so I want to display the values ​​in the box next to the slider after they are scaled to decimal values. I know how to do this, but not how to hide ToolTipText for a slider that shows only integer values.

Slider bar

+6
source share
1 answer

There is no easy way to remove this indicator, because it is not displayed through the control itself.

However, there are several solutions:

  • Windows Message Management and Interception Subclass

    Not for the faint of heart, complicated and redundant, but theoretically you can intercept Windows messages and drop those that correspond to the tooltip.
    This is not easy in VBA at all, and I would not even try. If you want to delve into this, take a look at an example in KB278379

  • Show just something.

    More interesting is the ability to change the displayed text to something else:

    Slider with custom text

    To change the text, handle the Scroll event and update the Text slider property:

     Private Sub MySlider_Scroll() MySlider.Text = "Awesomeness: " & (MySlider.Value * 7.89) End Sub 

    The event is not visible from the control properties themselves, but if you open the IDE and select "Slider" from the list of controls, you can create code to handle the Scroll event:

    Scroll event handler

+3
source

Source: https://habr.com/ru/post/911317/


All Articles