?
Solved

How to change width/height of multiple controls?

Posted on 2002-03-23
6
Medium Priority
?
172 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 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