473,788 Members | 2,841 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Widt h = 150;
_TableList.Heig ht = 100;
_TableList.Anch or = (AnchorStyles.L eft | AnchorStyles.Ri ght |
AnchorStyles.Bo ttom | AnchorStyles.To p);

I want the size of the listbox set here retained.

rotsey
Jun 27 '08 #1
2 2311
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.Widt h = 150;
_TableList.Heig ht = 100;
_TableList.Anch or = (AnchorStyles.L eft | AnchorStyles.Ri ght |
AnchorStyles.Bo ttom | AnchorStyles.To p);

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
2091
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 are taken to the more detail page I have a link to take you back to the list. This all works fine and is standard stuff. My problem is that the user wants the go back link on the detail page to
5
25855
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 function...if that makes sense. Here's what I mean... I have a javascript array set up like so: <script language="javascript" TYPE="text/JavaScript"> //custom object constructor
6
6662
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... I have a form with a lot of controls side by side, etc. The Anchor is really only useful to resize 1 control on each line (and move all the others). BUT, does anyone have any articles or other ways to do this? For example, I am working on...
3
3876
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 hyperlink control and you assign the navigateurl property = "../#anchor" whereby you want to add this # reference to the current url the url ends up with the #anchor twice.
10
2715
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. Thanks so much for reading about my problem! H
5
1750
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 yet as I couldn't come up with a decent anchor name. Some anchor names are duplicated (#ajax is one), where the idea would be to combine those entries into one entry. Any proposed anchor name changes, thoughts, or ideas are welcome. The major...
5
3199
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> Now on page2.php I have that anchor placed inside a header tag. The syntax is: <h2><a name="anchor">Header</a></h2> The link on page1.php to the anchor on page2.php works just find in IE7. But it doesn't work in firefox. The link takes the...
10
2494
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 sizes the listbox horizontally about nearly the same size as the split container width.
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10175
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10112
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.