Posted
on Jun 22, 2011
(permalink)
Hey, you know what, I know how to replicate it but not fix it.
It is due to a timer that we use as a fader to the form. so the main form starts at 0 opacity, then using the code below it increases the fade to 100%
******************** Code ******************************
Public Class Form1
Private m_showing As Boolean = True
Private Sub fadeTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles fadeTimer.Tick
Dim d As Double
If m_showing Then
d = (1000 / Me.fadeTimer.Interval) / 100
If Me.Opacity + d >= 1.0 Then
Me.Opacity = 1.0
Me.fadeTimer.Stop()
Else
Me.Opacity += d
End If
Else
d = (1000.0 / Me.fadeTimer.Interval) / 100.0
If Me.Opacity - d <= 0.0 Then
Me.Opacity = 0.0
Me.fadeTimer.Stop()
Else
Me.Opacity -= d
End If
End If
End Sub
Private Sub MainWindow_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Opacity = 0
Me.Activate()
Me.Refresh()
fadeTimer.Start()
Me.Refresh()
End Sub
End Class
******************** Designer *****************************
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits Telerik.WinControls.UI.RadForm
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.DesertTheme1 = New Telerik.WinControls.Themes.DesertTheme
Me.RadLabel1 = New Telerik.WinControls.UI.RadLabel
Me.RadLabel2 = New Telerik.WinControls.UI.RadLabel
Me.fadeTimer = New System.Windows.Forms.Timer(Me.components)
CType(Me.RadLabel1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.RadLabel2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'RadLabel1
'
Me.RadLabel1.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.RadLabel1.Location = New System.Drawing.Point(12, 54)
Me.RadLabel1.Name = "RadLabel1"
Me.RadLabel1.Size = New System.Drawing.Size(510, 21)
Me.RadLabel1.TabIndex = 0
Me.RadLabel1.Text = "all I did was add the telerik references then make the form's theme Desert"
'
'RadLabel2
'
Me.RadLabel2.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.RadLabel2.Location = New System.Drawing.Point(138, 98)
Me.RadLabel2.Name = "RadLabel2"
Me.RadLabel2.Size = New System.Drawing.Size(196, 21)
Me.RadLabel2.TabIndex = 1
Me.RadLabel2.Text = "Me.ThemeName = ""Desert"""
'
'fadeTimer
'
Me.fadeTimer.Interval = 50
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(531, 331)
Me.Controls.Add(Me.RadLabel2)
Me.Controls.Add(Me.RadLabel1)
Me.Name = "Form1"
Me.Opacity = 0
'
'
'
Me.RootElement.ApplyShapeToControl = True
Me.Text = "Form1"
Me.ThemeName = "Desert"
CType(Me.RadLabel1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.RadLabel2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents DesertTheme1 As Telerik.WinControls.Themes.DesertTheme
Friend WithEvents RadLabel1 As Telerik.WinControls.UI.RadLabel
Friend WithEvents RadLabel2 As Telerik.WinControls.UI.RadLabel
Friend WithEvents fadeTimer As System.Windows.Forms.Timer
End Class