vbAccelerator - Contents of code file: frmTest.frmVERSION 5.00
Begin VB.Form frmTest
Caption = "Flicker Free Drawing Using Memory DCs"
ClientHeight = 4395
ClientLeft = 60
ClientTop = 450
ClientWidth = 5640
BeginProperty Font
Name = "Tahoma"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
ScaleHeight = 4395
ScaleWidth = 5640
StartUpPosition = 3 'Windows Default
Begin VB.Timer tmrUpd
Enabled = 0 'False
Interval = 10
Left = 5040
Top = 3660
End
Begin VB.CheckBox chkFlickerFree
Caption = "Use &Mem DC"
Height = 255
Left = 4320
TabIndex = 1
Top = 600
Width = 1275
End
Begin VB.CommandButton cmdStart
Caption = "&Start"
Height = 435
Left = 4320
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "frmTest"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_c As New cDrawSample
Private Sub chkFlickerFree_Click()
If (chkFlickerFree.value = vbChecked) Then
' use mem dc
m_c.UseMemDc = True
Else
' don't use mem dc
m_c.UseMemDc = False
End If
End Sub
Private Sub cmdStart_Click()
If cmdStart.Caption = "&Start" Then
cmdStart.Caption = "&Stop"
tmrUpd.Enabled = True
Else
tmrUpd.Enabled = False
cmdStart.Caption = "&Start"
End If
End Sub
Private Sub Form_Load()
m_c.Left = cmdStart.Top \ Screen.TwipsPerPixelX
m_c.Top = cmdStart.Top \ Screen.TwipsPerPixelY
m_c.Width = Me.ScaleWidth \ Screen.TwipsPerPixelX - m_c.Left * 3 -
cmdStart.Width \ Screen.TwipsPerPixelX
m_c.Height = Me.ScaleHeight \ Screen.TwipsPerPixelY - m_c.Left * 2
Set m_c.Font = Me.Font
m_c.CreateObjects 24
End Sub
Private Sub tmrUpd_Timer()
m_c.Draw Me.hdc
End Sub
|