Solved

How to change width/height of multiple controls?

Posted on 2002-03-23
6
170 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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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