English 中文(简体)
VB6 - 文本箱之间的塔布。 如何总是在文本箱价值的末尾集中处理
原标题:VB6 - Tabbing between textboxes. How to get cursor focus always at the end of the textbox value
  • 时间:2012-01-12 20:40:57
  •  标签:
  • vb6
  • textbox

我有一系列文本箱,每个盒长8位数。 我有一顿子,通过表格和填满头4位数(0123)。 当我对文本框表进行表态时,我如何总是把曲线的焦点放在线上,即第四位数之后? 感谢:

最佳回答

将该守则列入您的资料来源档案。

Private Sub Text1_GotFocus()
    Text1.SelStart = Len(Text1.Text)
End Sub 

This assumes that you have a textbox named Text1. When it has the focus, the cursor is placed at the end of the textbox.

问题回答
Private Sub Text1_GotFocus()
  Text1.SelStart = 4
End Sub

如果说 w子是正确的,而你只想在报刊上这样做,而不是在点燃时,那么你将把现有的答案与表格结合起来。 关键事件,如果关键点为9,那是表塔,然后你可以采用Selstart方法。

由于你提到,你有一系列的文本箱,你可以采用单一方法,在文本箱的结尾处确定对表格“Load”的控制。 这需要比每个文本箱的活动手法少很多。

Dim o As Variant
For Each o In Form1.Controls
    If TypeName(o) = "TextBox" Then
        Dim x As TextBox
        Set x = o
        x.SelStart = Len(x.Text)
    End If
Next

然而,当用户改变任何文本箱中的曲线位置时,当他们离开并回到案文箱时,就会继续改变。 视你的情况而定,这可能是或可能不是想要的行为。 例如,任何文本箱都首次集中使用, cur子已经结束。 如果使用者决定改变治疗器的位置,离开,回到同一个文本箱,治疗器就离开了。





相关问题
Prevent windows from queuing shellexecute requests

Win.ShellExecute 0, "open", "C:dirprogram.exe", "arguments", vbNullString, SW_SHOWNORMAL Win.ShellExecute 0, "open", "http://www.google.com", vbNullString, vbNullString, SW_SHOWNORMAL I want google....

Why is My Loop Only Deleting One File?

Using VB6 In a folder, i have n number of files, i want to delete a 0 kb files code Dim filename5 As String filename5 = Dir$(txtsourcedatabasefile & "*_*", vbDirectory) MsgBox filename5 Do ...

How to check the filesize?

Using VB6 I have the text file with different sizes, so i want to delete the file where filesize = 0 kb. How to make a vb6 code for deleting the 0 kb files. Need vb6 code Help

File Rename problem?

I m using VB6 and I have a folder where I have n number of files. I want to change the file extension to .txt. I used the code below to change the extension of all .fin files to .txt. Dim filename1 ...

Error 20728-F while in using Crystal Reports in VB6

I m using Crystal Reports in my VB6 project, but I m facing error while loading the report in crystalreport1.action=1; Please give me some solution for this problem. It is showing the error as Error ...

DllRegisterServer entry point was not found

When running my vb6 application I am getting error like, runtime error 53 : file not found: rscomclNoMsg.dll then i tried to register that dll from cmd line using regsvr32. Then I am getting ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签