StartFromZero setting has no effect

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
Stuck on something...

I added a new setting for another chart control feature and it won't change. Can't seem to figure out what it lies for code. Part of the problem seems to be string vs integer.

The setting is another datavisualization deal. startfromzero

Form Load .... Populates the cbo just fine

VB.NET:
 Me.cboChartAreaColor.DataSource = [Enum].GetNames(GetType(KnownColor))


        'allow chart scale changes
        Me.CboChartScale.DataSource = [Enum].GetValues(GetType(StartFromZero))


       
        Me.CboChartScale.SelectedItem = My.Settings.ChartScale

Following the example code you provided I created this
VB.NET:
Private Sub CboChartScale_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles CboChartScale.SelectionChangeCommitted
        'get value
        Dim value = CType(CboChartScale.SelectedValue, StartFromZero)
        'update settings with new value
        My.Settings.ChartScale = value
    End Sub

I fiddled with several variations of the code in that sub but can't make it work. Selecting any of the options in the combobox has no effect.
 
Post moved to new thread "StartFromZero setting has no effect", because it is not related to thread "Allow users to set chart colors". Start new threads for new topics.

Selecting any of the options in the combobox has no effect
The only effect I can see is that you change My.Settings.ChartScale when user changes selection in combobox. What more do you want to happen?
 
Post moved to new thread "StartFromZero setting has no effect", because it is not related to thread "Allow users to set chart colors". Start new threads for new topics.


The only effect I can see is that you change My.Settings.ChartScale when user changes selection in combobox. What more do you want to happen?

I want the scale to change to either being scaled from zero or not be scaled from zero. Selecting from the 3 options of Auto, Yes, No in the combobox has no effect on the chart scale. Nothing blows up but the scale does not change either.

I don't know...perhaps going through setting isn't the best way to do this. Perhaps just setting up a combobox totally independent from my.settings is what I should be doing.
 
Resolved. Realized I didn't need to go through all the nonsense with my.settings and took a more direct approach with the combox.... I was making it harder than it had to be.
 
Back
Top