473,461 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to resize controls when resizing of form in VB.NET

Hi

i have two listview controls on my form one besides
another.When i resized the form ,i want to resize those
controls automatically along with the form.Where can i set
those properties in VB.NET or how can i do this...
If anyone knows please letme know,thanks in advance.
Mamatha
Nov 21 '05 #1
3 2788
Check the anchor property of a control

hth

Peter
"Mamatha" <ma***********@yahoo.com> wrote in message
news:1a****************************@phx.gbl...
Hi

i have two listview controls on my form one besides
another.When i resized the form ,i want to resize those
controls automatically along with the form.Where can i set
those properties in VB.NET or how can i do this...
If anyone knows please letme know,thanks in advance.
Mamatha

Nov 21 '05 #2
"Peter Proost" <pp*****@nospam.hotmail.com> schrieb:
Check the anchor property of a control


.... and the 'Dock' property too ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
The anchor property is a good idea, but not if the controls are beside
each other. You're going to have to use the form_resize event if you
want to resize both controls. Assuming that you want both controls to
be the same width and butted up against each other, use something like

Try
If Me.WindowState = FormWindowState.Minimized Then Exit Sub
l_size = (me.width - control1.left - extra_right_space) / 2
control1.width = l_size
control2.width = l_Size
control2.left = control1.left + l_size
Catch ex As Exception
End Try

If you want to automatically size the controls to the vertical height
of the control, then use the anchor property for top and bottom. Let
the CLR do some of the work.

Play with some margin space to put a little real estate between the
controls.
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Lubomir | last post by:
Hi, I am wondering if it is posible to disable resizing of a form in design editor. Or is it possible just at runtime? I don't see there any property kind of "Resize = false". Thank you, ...
3
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
1
by: Diogo Alves - Software Developer | last post by:
Hi there, Since my last questions wasn't very clear, I will do it in a different way. I want to resize my app but while resizing I dont want to see content of the form, I just want to see the...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
11
by: Ajith Menon | last post by:
I have created a windows application in which the form needs to be resized on the MouseMove event. The windows resize function takes a lot of CPU cycles. And as the resize function is called on the...
3
by: JT | last post by:
have a VB6 project that on the form I have set the BorderStile to 2 - sizable and created a function to resize the form and its controls min or max. Although, I am trying to find a way to...
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Hello, If I create a form in Java with controls like Panels, textboxes... when I stretch/shrink the form, all the controls can grow/shrink - along with the text contained in the textboxes. This...
0
by: Peter Anthony | last post by:
It seems kind of strange that if a Form is just moved that Resize events fire. This makes it hard to tell the difference betweeen resizing and moving a Form. I can understand why resizing might...
1
by: Bob Alston | last post by:
I have a system where many subforms are used. Often the size of the subform had to be larger than could be displayed without scrolling. I set the height of the subform to the typical height...
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.