Hi,
My opacity control causes a really bad BLACK flicker after the opacity is initially decreased via the trackbar control. Any ideas on how to get rid of the black flicker would be greatly appreciated.
PS: I tried calling Invalidate and ReDraw after Opacity is adjusted with no luck.
Some of the code...
//
// trackBar1
// Code located on the fader (opacity) control
this.trackBar1.Location = new System.Drawing.Point(26, 14);
this.trackBar1.Maximum = 100;
this.trackBar1.Minimum = 10;
this.trackBar1.LargeChange = 5;
this.trackBar1.SmallChange = 5;
this.trackBar1.Name = "trackBar1";
this.trackBar1.Size = new System.Drawing.Size(220, 45);
this.trackBar1.TabIndex = 0;
this.trackBar1.TickFrequency = 10;
this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.Both;
this.trackBar1.Value = 100;
this.trackBar1.MouseUp += new
System.Windows.Forms.MouseEventHandler(this.TrackBar1_ValueChanged);
private void TrackBar1_ValueChanged(object sender, System.EventArgs e)
{
if (_OpacityChanged != null)//run event
{
_OpacityChanged(this.trackBar1.Value);
}
}
// Code located on the main form. User clicks button to bring up control
private void faderControl_Click(object sender, EventArgs e)
{
FaderControl myFaderControl = new FaderControl();
myFaderControl._OpacityChanged += new
FaderControl.UpdateOpacity(OnOpacityChanged);
myFaderControl.ShowDialog();
}
private void OnOpacityChanged(double OpacityValue)
{
double newOpacityValue = OpacityValue / 100;
this.Opacity = newOpacityValue;
}