★★★敬请留意★★★:和微软一模一样的记事本的源代码(3) (转)

★★★敬请留意★★★:和微软一模一样的记事本的源代码(3) (转)[@more@]

 

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_GETLINECOUNT = &HBA
'Private Const EM_SCROLL = &HB5
'Private Const SB_LINEDOWN = 1
Dim Sline As Integer
Dim Lcount As Integer


 

'End Sub

Private Sub Command1_Click()
  Dim i As Integer
  Form1.Text1.SelStart = 0
  Form1.Text1.SetFocus
  Sline = SendMessage(Form1.Text1.hwnd, EM_GETLINECOUNT, 0&, 0&)
  Lcount = CInt(Text1.Text)
  If Lcount <= Sline Then
 
  For i = 1 To Lcount - 1
  SendKeys "{DOWN}"
  Next i
  Form3.Hide
  Else
  MsgBox "line over range"
 
  End If
  'Unload Form3
 ' Form3.Text1.SetFocus
End Sub


Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Form_Activate()
Form_Load
End Sub

Private Sub Form_Load()

Text1.SelStart = 0
If Text1.Text = "" Then
  Text1.Text = 0
Else
  Text1.Text = Lcount
End If


Text1.SelLength = Len(Lcount)
Form3.Show
Form3.Text1.SetFocus
End Sub

 


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-989357/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10752043/viewspace-989357/

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值