-
Hi Basp70,
I know this is a little lame but move the setfocus before the hide. Then do the hide and after that the show, this way the control already has the focus but the user can't do anything with it until the userform reapears.
[vba]
Private Sub CommandButton1_Click()
Set algemenedata = New DataObject
algemenedata.GetFromClipboard
If algemenedata.GetFormat(1) = True Then
TextBox2.Text = algemenedata.GetText(1)
Else
TextBox2.Text = "helemaal foute data, probeer het opnieuw"
End If
TextBox2.Text = algemenedata.GetText(1)
regel1 = GetLine(TextBox2.Text, 1)
'TextBox2.Text = regel1
If InStr(regel1, "Point:") Then
'moved to here set the focus before the hide
TextBox2.SetFocus
UserForm1.hide
returnPnt = ThisDrawing.Utility.GetPoint(, "click het nulpunt van het model aan ")
UserForm1.Show
teller = TextBox2.LineCount
For regelnummer = 1 To teller
regel1 = GetLine(TextBox2.Text, regelnummer)
regel2 = Right(regel1, (Len(regel1) - InStr(regel1, "<")))
xstr = Left(regel2, (InStr(regel2, ",") - 1))
xr = CDbl(xstr)
regel2 = Right(regel2, (Len(regel2) - InStr(regel2, ",")))
ystr = Left(regel2, (InStr(regel2, ",") - 1))
yr = CDbl(ystr)
regel2 = Right(regel2, (Len(regel2) - InStr(regel2, ",")))
zstr = Left(regel2, (InStr(regel2, ">") - 1))
zr = CDbl(zstr)
MsgBox (zstr)
Next regelnummer
Else
MsgBox ("Foute data, veld leeggemaakt probeer het opnieuw")
TextBox2.Text = ""
End If
'removed this one
'TextBox2.SetFocus
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules