it is jinxed. I don't find another solution. The code which doesn't work is very simple. While watching it with a breakpoint, IT WORKS! Otherwise it doesn't. I don't know why and it's driving me crazy.

There are two comboboxes. The choosen item is the title of the x/y-axis of a ZedGraphControl.
My code:

private void comboXAxis_SelectedIndexChanged(object sender, EventArgs e)
    measResultsGraph.XAxis.Title.Text = comboXAxis.SelectedItem + " [volt]";

private void comboYAxis_SelectedIndexChanged(object sender, EventArgs e)
    measResultsGraph.YAxis.Title.Text = comboYAxis.SelectedItem + " [amp]";

In my opinion this should work...and yes it does! But just with a breakpoint. Otherwise the title of the axes doesn't change. It's initialized with the first item of these comboboxes. This works also fantastically!

There's a gremlin in there...or I'm just blind!

Thanks for help.

Add measResultsGraph.Refresh() after where you change the title

There's no gremlin ;)
Thanks a lot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.