Solved

How to change width/height of multiple controls?

Posted on 2002-03-23
6
165 Views
Last Modified: 2010-05-02
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
Comment
Question by:baltman
  • 3
  • 2
6 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6891069
Look at wizard for creating app in VB and choose explorer like project, you will see how it is done.
0
 
LVL 3

Accepted Solution

by:
jbil earned 50 total points
ID: 6891531
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
 
LVL 1

Author Comment

by:baltman
ID: 6891827
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:baltman
ID: 6891829
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
 
LVL 3

Expert Comment

by:jbil
ID: 6891855
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
 
LVL 1

Author Comment

by:baltman
ID: 6891871
Already done...:o) That's the refining part.

Thanks again!

BA
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now