Article ID: 110989
Article Last Modified on 12/9/2003
Control Property Value
----------------------------------------
Picture Box Name PictureB
Index 0
AutoRedraw True
Picture Box Name PictureB
Index 1
AutoRedraw True
HEdit Control Name HEdit1
DelayRecog True
Text <blank>
Command Button Name Command1
Caption Clear
'Enter each of the following Declare statements on one, single line:
Declare Function GetDC Lib "USER" (ByVal hWnd As Integer) As Integer
Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer,
ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer,
ByVal nHeight As Integer, ByVal hSrsDC As Integer,
ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop) As Integer
Const SRCCOPY &H00CC0020& ' Will be used in the call to BitBlt
Dim LastPos As Integer ' Will be used to keep track of the
' last edited field.
Dim InkArray(2) As String ' This array will be used to store the
' InkDataString for each of the fields.
Sub Command1_Click ()
HEdit1.InkDataString = "" ' Clear the field.
End Sub
Sub Form_Load ()
Call PictureB_Click(0) ' Position the HEdit control over the
End Sub ' first field.
Sub Picture1_Click (index As Integer)
' Copy the image in the HEdit control to the Picture Box
destDC = GetDC(HEdit.hWnd)
' Enter the following three lines as one, single line:
dummy% = BitBlt(PictureB(LastPos).HDC, 0, 0,
PictureB(LastPos).ScaleWidth-2, PictureB(LastPos).ScaleHeight-2,
destDC, 1, 1)
InkArray(LastPos) = HEdit1.InkDataString
' Save the Ink data for this field. It will be reassigned
' to the HEdit control the next time that field is selected
' and the HEdit control is positioned on top of it.
LastPos = index ' Update LastPos to the current field.
HEdit1.Visible = False ' This prevent a flicker when the
' control is moved.
HEdit1.Top = PictureB(index).Top ' Move the HEdit Control on
HEdit1.Left = PictureB(index).Left ' top of the selected Picture
HEdit1.Width = PictureB(index).Width ' box field.
HEdit1.Height = PictureB(index).Height
HEdit1.InkDataString = InkArray(index) ' Reset the Ink in the
' Hedit Control to that
' stored for this field.
HEdit1.Visible = True
End Sub
Control Property Value
-----------------------------------------------------------
Label Name LabelF
Index 0
Caption <blank>
Label Name LabelF
Index 1
Caption <blank>
HEdit Control Name HEdit1
DelayRecog False
Text <blank>
Dim LastPos As Integer
Sub Form_Load ()
Call LabelF_Click (0)
End Sub
Sub LabelF_Click (index As Integer)
LabelF(LastPos).Caption = HEdit.Text ' Copy the contents of
' the HEdit Control to the
' Label Control.
LastPos = index ' Update LastPos to the current field.
HEdit1.Visible = False ' This prevent a flicker when the
' control is moved.
HEdit1.Top = LabelF(index).Top ' Move the HEdit Control on
HEdit1.Left = LabelF(index).Left ' top of the selected Picture
HEdit1.Width = LabelF(index).Width ' Box field.
HEdit1.Height = LabelF(index).Height
HEdit1.Text = LabelF(index).Caption ' Reset the Ink in the HEdit
' Control to that stored for
' this field.
HEdit1.Visible = True
End Sub
Additional query words: buglist2.00 buglist3.00 2.00 3.00 fixlist4.00
Keywords: kbbug kbfix KB110989