• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

How to change width/height of multiple controls?

Hi All,

I want to know how I can have eg. one Listview control on the upper half of the form and one textbox on the lower half of the form (both take up half of the form upon loading). Now I want to be able to change the height of both controls, by clicking in the middle of those two controls and dragging up and/or down, resizing both controls......

Am I making any sense?

Any ideas would be appreciated!

Thanks,

BA
0
baltman
Asked:
baltman
  • 3
  • 2
1 Solution
 
Richie_SimonettiIT OperationsCommented:
Look at wizard for creating app in VB and choose explorer like project, you will see how it is done.
0
 
jbilCommented:
You could, use a thin label between the two controls with code like this...

Private Sub Form_Load()
Label1.Width = Text1.Width
Label1.Left = Text1.Left
Label1.Top = Text1.Top - Label1.Height
Label1.BackColor = Me.BackColor
Label1.BorderStyle = 0
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
        Label1.Top = Label1.Top + Y
        ListView1.Height = Label1.Top - ListView1.Top
        Text1.Top = Label1.Top + Label1.Height
        Text1.Height = Text1.Height - Y
    End If

End Sub

then click between the controls and move up or down.
0
 
baltmanAuthor Commented:
Hi jbil, thanks for the answer! Works without problems. The previous comment about opening the wizzard and look how an explorer style project was done was also ok, but way too complicated and too much coding for my app. Besides, those example things always have much more code and are much more complicated than they have to be...

This code works (just need to refine it a bit), so here's the points!

Thanks!

BA
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
baltmanAuthor Commented:
Hi jbil, thanks for the answer! Works without problems. The previous comment about opening the wizzard and look how an explorer style project was done was also ok, but way too complicated and too much coding for my app. Besides, those example things always have much more code and are much more complicated than they have to be...

This code works (just need to refine it a bit), so here's the points!

Thanks!

BA
0
 
jbilCommented:
baltman,

Thanks for the points!, Dont forget to add some error trapping, for when user goes to far values will be out of range :)
0
 
baltmanAuthor Commented:
Already done...:o) That's the refining part.

Thanks again!

BA
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now