473,385 Members | 1,320 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,385 software developers and data experts.

Anchor listbox problem

Hi,

I have a Listbox in a Panel of SplitContainer.

I want to anchor it so the listbox grows/shrinks vertically with the
resizing the splitcontainer.

This is my code
What happens is it sizes the listbox horizontally about nearly the same size
as the split container width.
_TableList = new MdsListBox();

_TableList.Name = "TableList";
_TableList.Left = 10;
_TableList.Top = 40;
_TableList.Width = 150;
_TableList.Height = 100;
_TableList.Anchor = (AnchorStyles.Left | AnchorStyles.Right |
AnchorStyles.Bottom | AnchorStyles.Top);

I want the size of the listbox set here retained.

rotsey
Jun 27 '08 #1
2 2293
Hi Rotsey,

It is a bit unclear what you want to achieve. You have set the anchor
styles to resize the ListBox both horizontally and vertically. Adjusting a
vertical splitter bar will therefore change the size of the ListBox
accordingly by adjusting its Width. Likewise, adjusting a horizontal
splitter bar will adjust the ListBox' Height.

What exactly is it you want the ListBox do to when the splitter bars are
adjusted?

--
Happy Coding!
Morten Wennevik [C# MVP]
"Rotsey" wrote:
Hi,

I have a Listbox in a Panel of SplitContainer.

I want to anchor it so the listbox grows/shrinks vertically with the
resizing the splitcontainer.

This is my code
What happens is it sizes the listbox horizontally about nearly the same size
as the split container width.
_TableList = new MdsListBox();

_TableList.Name = "TableList";
_TableList.Left = 10;
_TableList.Top = 40;
_TableList.Width = 150;
_TableList.Height = 100;
_TableList.Anchor = (AnchorStyles.Left | AnchorStyles.Right |
AnchorStyles.Bottom | AnchorStyles.Top);

I want the size of the listbox set here retained.

rotsey
Jun 27 '08 #2
This is a duplicate; longer chain already on dotnet.general
Jun 27 '08 #3

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

Similar topics

2
by: Astra | last post by:
Hi everybody Need your help. I have a DB-extracted list of say 5 items per page, which have links on each one that takes you to more detailed info on the 'clicked' particular item. When you...
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
6
by: Richard Brown | last post by:
Ok, I celebrate and rejoice in the Anchor property. So wonderful compared to the horrible 'resize' code I had to write in VB6, there is just no end to the wonders of VB.NET..... uh, ok..... BUT......
3
by: gary | last post by:
Hi, I am trying to reference an anchor in a user control with a url. This worked in 1.1 but no longer works in 2.0. The ascx control is located in a "/include" folder If you have a...
10
by: elibol | last post by:
Hi, Is there an event that fires when the back or forward button on a browser is pressed? I need an event to fire when someone clicks the back or forward button after an anchor has been set. ...
5
by: Randy Webb | last post by:
The list below has the current section number, proposed anchor name, and then the current title of that section. Some make sense, some don't. There are a few that don't have proposed anchor names...
5
by: Meadock | last post by:
Here's an example of what i'm trying to do. At www.webpage.com/page1.php, there's a link that points to an anchor at www.webpage.com/page2.php. The syntax is: <a href="page2.php#anchor">Link</a>...
10
by: Rotsey | last post by:
Hi, I have a Listbox in a Panel of SplitContainer. I want to anchor it so the listbox grows/shrinks vertically with the resizing the splitcontainer. This is my code What happens is it...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.