We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Radial Slider Frustration - Click Through and Non-Update

I'm getting to grips with the Windows Forms tools, using VB and VS 2013, by putting a small app to play random lengths of two MP3 files. It's a kind of novelty musical chairs for a fencing tournament.

To control volume, I'm using the Radial Slider (.sliderstyle is set to default). Two problems...

First, I stash the value for the slider in the registry so I can put it back on re-opening. The value gets set, but the display doesn't update. I thought that either the Update or the Refresh method would do that, but neither appears to do anything.

Second, I use an openfiledialog to select the files to play. I select a file and double-click. If that double-click happens to be over the radial slider, then it clicks right on through and changes the slider value.

How do I cause the displayed slider to refresh when I set the Value from the registry? How do I prevent the click from the file dialog carrying over to the slider?

Thanks in advance .. I hope...

6 Replies

VI Vinothini Syncfusion Team May 12, 2014 12:21 PM UTC

Hi Robert,

Thank you for using Syncfusion products,

We would like to let you know that currently we are working on your query. We will update you the details before the end of May 13th,2014. 

Please let us know if you have any concerns,

Regards,

Vinothini .R



VI Vinothini Syncfusion Team May 13, 2014 11:22 AM UTC

Hi Robert,

Thank you for the patience,

Query 1: We would like to let you know that in RadialSlider Value property is working as expected. We have changed the radial slider value by using the TextBox's textchanged event and there is no need to call any update or refresh method.

Query 2: We would like to let you know that the radial slider responds to the mouse click only when its parent form contains the focus and when the OpenFileDialog opens, radial slider does not catch the mouse click.

We have prepared a sample for your requirement and it is available in the following location. Please look into the sample and confirm us whether this is your requirement or could you please modify in this sample to reproduce the issue.

Link: http://www.syncfusion.com/uploads/user/directTrac/124903/RadialSlider-1621716490.zip

Please let us know if you need any further assistance .

Regards,

Vinothini .R



RS Robert Smith May 13, 2014 07:21 PM UTC

Unmodified, your sample still does some pretty weird things.

Run it, open the file dialog and position it so it's over the active part of the radial slider. Double click a file. If the click is over the active area, as the file dialog closes you will see the marker on the radial slider flicker from the set position to ... somewhere else, I'd assume the click point, and then flick back to the correct setting. It's a little easier to replicate if you stretch out the control to cover a larger area of screen, for a larger target.

Another strange thing that happens with your example is that all other controls on the form are only partially rendered until the cursor is moved out of the rectangle owned by the radial slider. Not sure if this image will get through to the forum, but here goes:



This happens with both Default and Frame SliderStyles.

Another manifestation occurs when I change the code to set the textbox from the slider. The code you provided sets slider value to text box value when the slider is changed (?!), so I commented out the first line and un-commented the second as follows:

        private void radialSlider1_ValueChanged(object sender, Syncfusion.Windows.Forms.Tools.RadialSlider.ValueChangedEventArgs args)
        {
            //this.radialSlider1.Value = Double.Parse(this.textBoxExt1.Text);
            this.textBoxExt1.Text = this.radialSlider1.Value.ToString();
            this.radialSlider1.Refresh();
        }

Now it resets the textbox value correctly - but ONLY once the cursor is moved out of the active area of the radial slider.

As to my specific problems, the retrieval and restoration of a value from the registry is still an issue. With this code:

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        SaveSetting("MP3_Randomizer", "Saved Settings", "Volume", RadialSlider1.Value.ToString)

    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        RadialSlider1.Value = CDbl(GetSetting("MP3_Randomizer", "Saved Settings", "Volume", ""))

        MsgBox("Value = " & RadialSlider1.Value)
    End Sub

the value is set, but the display is not updated. Try it yourself by adding

            this.textBoxExt1.Text = "7";

at line 17, so the code reads:

        public Form1()
        {
            InitializeComponent();
          //  this.radialSlider1.Refresh();
            this.textBoxExt1.Text = "7";
            this.radialSlider1.Update();
            this.radialSlider1.Value = Double.Parse(this.textBoxExt1.Text);
            this.radialSlider1.Update();
        }

I have attached a simple example in VB that sets and restores slider values to and from the registry. Try it out, please, and let me know why the slider is not updated on initialization.

Attachment: RadialSlider_From_Registry_b52a33c2.zip


VI Vinothini Syncfusion Team May 14, 2014 12:32 PM UTC

Hi Robert,

Thank you for your update,

Query 1: We would like to let you know that the value of the textbox gets updated on changing the radial slider value by using this.refresh() method as in the following code snippet.

Code Snippet[c#]:

private void radialSlider1_ValueChanged(object sender, Syncfusion.Windows.Forms.Tools.RadialSlider.ValueChangedEventArgs args)
        {
            this.textBoxExt1.Text = this.radialSlider1.Value.ToString();
            this.Refresh();
        }

Query 2: We would like to let you know that the range slider value can be updated on initialization by setting the SliderStyle property to Frame.Please make use of the modified sample in the following location.


Please let us know if you have any concerns,

Regards,
Vinothini .R


RS Robert Smith May 14, 2014 07:30 PM UTC

Hi Vinothini,

Still missing the point a little. Your code sets the slider value to 5 in InitializeComponent at line 63, but your textBoxExt1_TextChanged changes it again to the value at line 76. Comment out line 77 to prevent that event from firing, and the value on start-up should be  5. It's not. I set properties for a number of other controls in InitializeComponent and they work just fine, but not the radial slider. Adding a Refresh to the code as line 65 made no difference. I found eventually that I could get it to work if I put my retrieval from the registry into the form's Paint event, but I had expected that InitializeComponent would be the correct place to do it. Maybe I'm wrong.

On the other issue of the click-through, that still occurs. It's easier to invoke if you make the control larger, so adjust to suit. Click to open the file dialog, place the dialog over the radial slider control and double-click a file with the cursor over the active part of the control - so any place where a click would change the value if the dialog wasn't there. You will find that it DOES change the slider value, just as if you had clicked it directly. If you single-click then click the Open button, no click is picked up by the slider, but who would do that instead of double-click? It's not going to happen every time in real life, as most of the time the file name won't be over the slider, but it will happen and shouldn't. I found a way around by setting the cursor position back to the button immediately after the dialog closes, but that shouldn't be necessary.



VI Vinothini Syncfusion Team May 15, 2014 06:48 AM UTC

Hi Robert,

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Please let me know if you have any questions.

Regards,
Vinothini R


Loader.
Live Chat Icon For mobile
Up arrow icon