
Dim val As Integer
Dim textid As Long
Dim ScrRect As MICRODRAWOCXLib.AsRect
Dim TextRect As MICRODRAWOCXLib.AsRect
Private Sub Command1_Click()
textid = MicroDrawOcx1.FindText(Text1.Text, 0)
If textid > 0 Then '找到文字,居中显示
  Set ScrRect = MicroDrawOcx1.GetScreenRect()
  Set TextRect = MicroDrawOcx1.GetRectEx(textid)
  MicroDrawOcx1.PanView TextRect.Center().x, TextRect.Center().y, ScrRect.Center().x, ScrRect.Center().y
  
  Timer1.Interval = 100
End If
End Sub
Private Sub Command2_Click()
Timer1.Interval = 0
End Sub
Private Sub Form_Load()
val = 0
End Sub
Private Sub Timer1_Timer()
If textid > 0 Then
  val = val + 1
  Text = Text2.Text + Str(val)
  MicroDrawOcx1.SetLong textid, LONG_DISPLAY_WIDTH, 3
  MicroDrawOcx1.SetObjectColor textid, RGB(0, 255, 0)
  MicroDrawOcx1.SetString textid, STRING_TEXT_STRING, Text
  MicroDrawOcx1.RedrawObject textid
End If
End Sub
源码可以到 www.microdraw.cn 下载



 
											





 
	    

 
	