473,396 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Autoresize Listbox with Form

Hi all,
I have 3 Listboxes which i want to resize automatically when the forms
resizes. I played with anchors but when i rersize to much the
listboxes starts to overlap eachother. How can i accomplish to make
something that works well without overlapping ?

Mihai
Nov 15 '05 #1
6 3398
*Mihai Marinescu* tippselte am *19.10.2003 14:24* MESZ:
I have 3 Listboxes which i want to resize automatically when the forms
resizes. I played with anchors but when i rersize to much the
listboxes starts to overlap eachother. How can i accomplish to make
something that works well without overlapping ?


Do you like to have a view like this?

http://great.dynu.com/temp/csharp_listviews.jpg

In that case, set the following properties:

Object - Anchor
~~~~~~~~~~~~~~~

The upper left list view - Top, Bottom, Left, Right
The upper right list view - Top, Bottom, Right
The lower list view - Bottom, Left, Right

HTH,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #2
Yes that's it but i also have a button which is placed between the upper
listboxes and the lower one. What anchor should that one have ?

Mihai

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3
*Mihai Marinescu* tippselte am *19.10.2003 17:07* MESZ:
Yes that's it but i also have a button which is placed between the upper
listboxes and the lower one. What anchor should that one have ?


Like this?

http://great.dynu.com/temp/csharp_listviews2.jpg

Set the button's anchor to 'Bottom, Left'.

In case you don't understand the anchor property: It specifies, to which
borders of its container (the control where the relevant control 'lies
in' or 'is a member of') it should hold a constant distance. In your
case you want that the button has always the same x-position (by that,
keeps its distance to the left border of the form) and increases its
y-position if you heighten the form (by that, keeps its distance to the
bottom border of the form).

Best regards,

Michael

--
Michael Kremser
http://great.dynu.com/

Nov 15 '05 #4
Lets make this a bit more challenging...

What if the button is between the top two listboxes? That's what I'm
needing and I can't get this to work with the Anchor property.

Suggestions?

Thanks!

Brian
Michael Kremser <us****************@aon.at> wrote in message news:<u8**************@TK2MSFTNGP09.phx.gbl>...
*Mihai Marinescu* tippselte am *19.10.2003 17:07* MESZ:
Yes that's it but i also have a button which is placed between the upper
listboxes and the lower one. What anchor should that one have ?


Like this?

http://great.dynu.com/temp/csharp_listviews2.jpg

Set the button's anchor to 'Bottom, Left'.

In case you don't understand the anchor property: It specifies, to which
borders of its container (the control where the relevant control 'lies
in' or 'is a member of') it should hold a constant distance. In your
case you want that the button has always the same x-position (by that,
keeps its distance to the left border of the form) and increases its
y-position if you heighten the form (by that, keeps its distance to the
bottom border of the form).

Best regards,

Michael

Nov 15 '05 #5
You can hook Resize event of the form and set locations / sizes of controls
in there.

HTH
Alex

"BrianC" <br***********@hotmail.com> wrote in message
news:39**************************@posting.google.c om...
Lets make this a bit more challenging...

What if the button is between the top two listboxes? That's what I'm
needing and I can't get this to work with the Anchor property.

Suggestions?

Thanks!

Brian
Michael Kremser <us****************@aon.at> wrote in message

news:<u8**************@TK2MSFTNGP09.phx.gbl>...
*Mihai Marinescu* tippselte am *19.10.2003 17:07* MESZ:
Yes that's it but i also have a button which is placed between the upper listboxes and the lower one. What anchor should that one have ?


Like this?

http://great.dynu.com/temp/csharp_listviews2.jpg

Set the button's anchor to 'Bottom, Left'.

In case you don't understand the anchor property: It specifies, to which
borders of its container (the control where the relevant control 'lies
in' or 'is a member of') it should hold a constant distance. In your
case you want that the button has always the same x-position (by that,
keeps its distance to the left border of the form) and increases its
y-position if you heighten the form (by that, keeps its distance to the
bottom border of the form).

Best regards,

Michael

Nov 15 '05 #6
Yes, I agree that will work. However, I'm creating a UserControl and
I would like for the controls to resize at design time when the user
resizes the control on his/her form. The Resize event will not help
me there, will it? Any ideas?

Thanks!

Brian

"AlexS" <sa***********@SPAMsympaticoPLEASE.ca> wrote in message news:<uo**************@TK2MSFTNGP09.phx.gbl>...
You can hook Resize event of the form and set locations / sizes of controls
in there.

HTH
Alex

"BrianC" <br***********@hotmail.com> wrote in message
news:39**************************@posting.google.c om...
Lets make this a bit more challenging...

What if the button is between the top two listboxes? That's what I'm
needing and I can't get this to work with the Anchor property.

Suggestions?

Thanks!

Brian
Michael Kremser <us****************@aon.at> wrote in message

news:<u8**************@TK2MSFTNGP09.phx.gbl>...
*Mihai Marinescu* tippselte am *19.10.2003 17:07* MESZ:

> Yes that's it but i also have a button which is placed between the upper > listboxes and the lower one. What anchor should that one have ?

Like this?

http://great.dynu.com/temp/csharp_listviews2.jpg

Set the button's anchor to 'Bottom, Left'.

In case you don't understand the anchor property: It specifies, to which
borders of its container (the control where the relevant control 'lies
in' or 'is a member of') it should hold a constant distance. In your
case you want that the button has always the same x-position (by that,
keeps its distance to the left border of the form) and increases its
y-position if you heighten the form (by that, keeps its distance to the
bottom border of the form).

Best regards,

Michael

Nov 15 '05 #7

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

Similar topics

4
by: f_salazar | last post by:
English Version !! Hi !! I have a page with a Form, inside the form I have listbox with 'X' elements. Wend I submit the page, an ASP process inside the page have to read those elements and...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
6
by: Janaka | last post by:
Help! I have two ListBox controls on my web form. The first one gets populated on entry with values from the DB. I then use JavaScript to copy options from this ListBox to my second one. (I...
11
by: Chippy | last post by:
This is driving me NUTZ. All of my forms are keeping the size of the window I design them in, even when I have the AutoResize option set to Yes. The actual form (grey, gridded area) is the size...
1
by: ANDRESUK | last post by:
All I have a listbox in a form footer. When the form footer is visible the listbox requeries fine but when I turn the form footer visible=false the listbox does not requery at all. What I am...
8
by: nirdeshonline | last post by:
Hi, I have added a simple listbox in windows form under c# 2.0. It contains a collection of approx 10 strings as list items. Now when i resize the form whole listbox flickers. Please tell me...
1
by: Steve Richter | last post by:
I have a form. In the Form is a MenuStrip and a FlowLayoutPanel. In the FlowLayoutPanel is a ListBox. The FlowLayoutPanel is set to DockStyle.Fill. The ListBox is set to AnchorStyles.Left |...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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,...

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.