VB出了什么问题? [英] VB Whats the problem?.............................

查看:59
本文介绍了VB出了什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码有什么问题?

Whats the problem with this code?

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If (Cursor.Position = New Point(Me.Location.X >= 350, Me.Location.Y)) Then
        MessageBox.Show("LOL")
    End If

End Sub

推荐答案

您可以找到用于编译代码的错误,但无济于事.正如方法名称所暗示的那样(该名称违反了Microsoft命名规则),它将在计时器滴答时被调用.什么,您真的想要不限数量的文本框彼此重叠吗?

只是不做.更进一步:不要使用计时器,尤其是System.Windows.Forms.Timer.太无聊了,不能解释为什么...
更好的是,您解释了为什么要使用它吗?只是尝试?我能理解的...

—SA
You can find the bugs to compile the code, but it won''t help. As the name of the method suggests (the name violates Microsoft naming rules), it will be called on timer tick. What, you really want unlimited number text boxes on top of each other?

Just don''t do it. One step further: don''t use timer, especially System.Windows.Forms.Timer. Too boring to explain why…
Better, you explain why using it? Just to try? This I can understand…

—SA


是用VB编写的吗? :)

严重地,Point需要两个整数,而不是bool和int.您不能将比较作为两个参数之一.

您实际上想做什么?


如果光标到达应用程序的某个点,它将执行某些操作"


然后尝试:
It''s written in VB? :)

Seriously, a Point requires two integers, not a bool and an int. You can''t do the compare as one of the two parameters.

What are you actually trying to do?


"If my cursor reaches past a certain point of the app it will do something"


Then try:
If (Cursor.Position.X >= 350)
   ...
End If


这篇关于VB出了什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆