-
Mar 2nd, 2012, 06:33 PM
#1
Thread Starter
Hyperactive Member
Text Box Dragging
Ihave this code so when you press a button it generates a text box
Code:
Dim txt As New TextBox
txt.AllowDrop = True
txt.Multiline = True
Me.Controls.Add(txt)
But i wanted to ad vb script to the text box what property would i do that with?
Last edited by sherlockturtle; Mar 2nd, 2012 at 07:14 PM.
-
Mar 2nd, 2012, 07:47 PM
#2
Re: Text Box Dragging
i don't understand the question...
can you explain exactly what you're trying to do?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 2nd, 2012, 07:49 PM
#3
Thread Starter
Hyperactive Member
Re: Text Box Dragging
I have a button that creates a text box but i want it to create a drag gable text box. How would id do that?
-
Mar 2nd, 2012, 08:50 PM
#4
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 2nd, 2012, 09:16 PM
#5
Thread Starter
Hyperactive Member
Re: Text Box Dragging
My visual basic 2010 was not abel to open it.
-
Mar 2nd, 2012, 09:22 PM
#6
Re: Text Box Dragging
why not? what was the error?
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 2nd, 2012, 09:23 PM
#7
Thread Starter
Hyperactive Member
Re: Text Box Dragging
It just said it was not abel to read it.
-
Mar 2nd, 2012, 09:34 PM
#8
Re: Text Box Dragging
the 3 different versions have been downloaded 435 times in total + you're the first who can't open it
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 2nd, 2012, 09:46 PM
#9
Re: Text Box Dragging
ok. different method:
vb Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tb As New TextBox
Me.Controls.Add(tb)
AddHandler tb.MouseMove, AddressOf tb_MouseMove
End Sub
Private Const WM_NCLBUTTONDOWN As Integer = &HA1
Private Const HTCAPTION As Integer = 2
Private Sub tb_MouseMove(ByVal sender As System.Object, ByVal e As MouseEventArgs)
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.Capture = False
Dim m As Message = Message.Create(tb.Handle, WM_NCLBUTTONDOWN, New IntPtr(HTCAPTION), IntPtr.Zero)
MyBase.DefWndProc(m)
End Sub
End Class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Mar 2nd, 2012, 10:09 PM
#10
Thread Starter
Hyperactive Member
Re: Text Box Dragging
Originally Posted by .paul.
ok. different method:
vb Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tb As New TextBox
Me.Controls.Add(tb)
AddHandler tb.MouseMove, AddressOf tb_MouseMove
End Sub
Private Const WM_NCLBUTTONDOWN As Integer = &HA1
Private Const HTCAPTION As Integer = 2
Private Sub tb_MouseMove(ByVal sender As System.Object, ByVal e As MouseEventArgs)
Dim tb As TextBox = DirectCast(sender, TextBox)
tb.Capture = False
Dim m As Message = Message.Create(tb.Handle, WM_NCLBUTTONDOWN, New IntPtr(HTCAPTION), IntPtr.Zero)
MyBase.DefWndProc(m)
End Sub
End Class
Thanks Dude
-
Mar 2nd, 2012, 10:37 PM
#11
Thread Starter
Hyperactive Member
Re: Text Box Dragging
I also tried doing it with a rich text box but it is not moving
Code:
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
Dim tb1 As New RichTextBox
Me.Controls.Add(tb1)
AddHandler tb1.MouseMove, AddressOf tb1_MouseMove
End Sub
Private Const WM_NCLBUTTONDOWN1 As Integer = &HA1
Private Const HTCAPTION1 As Integer = 21
Private Sub tb1_MouseMove(ByVal sender As System.Object, ByVal e As MouseEventArgs)
Dim tb1 As RichTextBox = DirectCast(sender, RichTextBox)
tb1.Capture = False
Dim m1 As Message = Message.Create(tb1.Handle, WM_NCLBUTTONDOWN1, New IntPtr(HTCAPTION1), IntPtr.Zero)
MyBase.DefWndProc(m1)
End Sub
-
Mar 3rd, 2012, 08:52 AM
#12
Re: Text Box Dragging
HTCAPTION1 should be 2, not 21
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
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
|
Click Here to Expand Forum to Full Width
|