how to resize

what i have ia text box and i want the  user to be able to resize it at run time. So if you position the mouse over the edge and left click and hold i want the movment of the mouse left and right to change the size of the box. any ideas
kplonkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tirupur_selvaCommented:
I think its quite difficult. But you can do it. You have to write the code in the Mousemove event. In the mousedown event you keep some flag and set it to true, if the mouse is pressed down at the edge. Then in the move event, you should proportionately increase the width and height of the text box.

I would suggest another easier method. You could place a slider bar and when the user moves the slider bar you can increase or decrease the size of the text box.
0
kplonkAuthor Commented:
hm interesting idea but is not the standard way to do it, thanks for the advice.
0
mcriderCommented:
Try this... If you use it, please reject the current answer and select this as the answer...


1) Start a new project.

2) Add a picturebox to Form1.

3) Add a textbox as a child of the picturebox.

4) Set the borderstyle of the picturebox to NONE.

5) Add the following code to the DECLARATION SECTION of form1:

    Private Sub Form_Load()
        Picture1_Resize
    End Sub
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            Select Case Y
                Case 0 To Picture1.Height - 50
                    Picture1.Tag = "WE"
                Case Else
                    Picture1.Tag = "NS"
            End Select
        End If
    End Sub
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim lXY As Long
    On Error Resume Next
    Select Case Picture1.Tag
        Case "WE"
                    lXY = Picture1.Height
                    If Button = 1 Then
                        Picture1.Width = X
                        Picture1.Height = lXY
                    End If
        Case "NS"
                    lXY = Picture1.Width
                    If Button = 1 Then
                        Picture1.Height = Y
                        Picture1.Width = lXY
                    End If
        Case Else
            Select Case Y
                Case 0 To Picture1.Height - 50
                    Picture1.MousePointer = vbSizeWE
                Case Else
                    Picture1.MousePointer = vbSizeNS
            End Select
    End Select
    End Sub
    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Picture1.Tag = ""
    End Sub
    Private Sub Picture1_Resize()
        On Error Resume Next
        Text1.Top = 0
        Text1.Left = 0
        Text1.Height = Picture1.Height - 40
        Text1.Width = Picture1.Width - 40
    End Sub
    Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        Picture1.MousePointer = vbDefault
    End Sub



6) Run the program, and resize the textbox...


Hope this helps!


Cheers!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

caraf_gCommented:
waty also did a very good one...

http://oldlook.experts-exchange.com/bin/Q.10118437
0
kplonkAuthor Commented:
sorry this is not that good thanks any way.
0
mcriderCommented:
Did you try my comment?

Cheers!
0
caraf_gCommented:
What! You call a code sample by waty "not that good"?

Heretic!!

(just kidding)
0
kplonkAuthor Commented:
ya man how the hell do i accept a comment as an answer to a question?
0
caraf_gCommented:
Check the "title bar" above the comment you want to accept. In there there's a hotlink for "accept comment as answer"
0
kplonkAuthor Commented:
nice
0
mcriderCommented:
Thanks for the points! Glad I could help!


Cheers!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.