TrackBar appearance inconsistency
-
I have two test apps (acquired from different sources) that include the System.Windows.Forms.TrackBar. The relevant settable properties seem to be equivalent and in the VS Designer, the TrackBars look the same in both apps. But when running, their appearance is different. One has the green bars on the slider and the other doesn't. There must be something different, but I can't find it. :confused: Will someone point me in the right direction? This one shows the green highlight bars. All this code is in the form constructor.
tBarBalance = new System.Windows.Forms.TrackBar();
tBarBalance.AutoSize = false;
tBarBalance.Location = new System.Drawing.Point(x, y);
tBarBalance.Maximum = 320;
tBarBalance.Minimum = -320;
tBarBalance.Name = "tBarBalance";
tBarBalance.Size = new System.Drawing.Size(60, 30);
tBarBalance.TickFrequency = 320;
tBarBalance.TabIndex = i;
tBarBalance.SmallChange = 10;
tBarBalance.LargeChange = 50;
tBarBalance.Tag = line;
tBarBalance.ValueChanged += new System.EventHandler(tBarBalance_ValueChanged);
this.Controls.Add(tBarBalance);This one doesn't have the green highlight. This code is in the
InitializeComponent
method. I tried it without theBeginInit
andEndInit
calls, but that made no difference. The non-defaultAutoSize = false
(from above) made no difference either.trkBalance = new TrackBar();
((System.ComponentModel.ISupportInitialize)(trkBalance)).BeginInit();
trkBalance.Location = new System.Drawing.Point(56, 46);
trkBalance.Maximum = 10000;
trkBalance.Minimum = -10000;
trkBalance.Name = "trkBalance";
trkBalance.Size = new System.Drawing.Size(108, 45);
trkBalance.TabIndex = 1;
trkBalance.TickFrequency = 1000;
toolTip.SetToolTip(trkBalance, "Balance");
trkBalance.Scroll += new System.EventHandler(trkBalance_Scroll);
this.Controls.Add(trkBalance);
((System.ComponentModel.ISupportInitialize)(trkBalance)).EndInit();What say ye?
-
I have two test apps (acquired from different sources) that include the System.Windows.Forms.TrackBar. The relevant settable properties seem to be equivalent and in the VS Designer, the TrackBars look the same in both apps. But when running, their appearance is different. One has the green bars on the slider and the other doesn't. There must be something different, but I can't find it. :confused: Will someone point me in the right direction? This one shows the green highlight bars. All this code is in the form constructor.
tBarBalance = new System.Windows.Forms.TrackBar();
tBarBalance.AutoSize = false;
tBarBalance.Location = new System.Drawing.Point(x, y);
tBarBalance.Maximum = 320;
tBarBalance.Minimum = -320;
tBarBalance.Name = "tBarBalance";
tBarBalance.Size = new System.Drawing.Size(60, 30);
tBarBalance.TickFrequency = 320;
tBarBalance.TabIndex = i;
tBarBalance.SmallChange = 10;
tBarBalance.LargeChange = 50;
tBarBalance.Tag = line;
tBarBalance.ValueChanged += new System.EventHandler(tBarBalance_ValueChanged);
this.Controls.Add(tBarBalance);This one doesn't have the green highlight. This code is in the
InitializeComponent
method. I tried it without theBeginInit
andEndInit
calls, but that made no difference. The non-defaultAutoSize = false
(from above) made no difference either.trkBalance = new TrackBar();
((System.ComponentModel.ISupportInitialize)(trkBalance)).BeginInit();
trkBalance.Location = new System.Drawing.Point(56, 46);
trkBalance.Maximum = 10000;
trkBalance.Minimum = -10000;
trkBalance.Name = "trkBalance";
trkBalance.Size = new System.Drawing.Size(108, 45);
trkBalance.TabIndex = 1;
trkBalance.TickFrequency = 1000;
toolTip.SetToolTip(trkBalance, "Balance");
trkBalance.Scroll += new System.EventHandler(trkBalance_Scroll);
this.Controls.Add(trkBalance);
((System.ComponentModel.ISupportInitialize)(trkBalance)).EndInit();What say ye?
Hi, Have a look at Application.EnableVisualStyles(); maybe that is the relevant difference between both apps. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
-
Hi, Have a look at Application.EnableVisualStyles(); maybe that is the relevant difference between both apps. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused:
Thanks, that's exactly it.
Application.EnableVisualStyles();
was the difference. :doh: