Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

How to change width/height of multiple controls?

Posted on 2002-03-23
6
Medium Priority
?
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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
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!

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

649 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