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

Usercontrol as a container and docked constituents

Hi all,

I've been struggling with some strange VB behaviour for the last two days.
I have created a usercontrol and placed two buttons in it. One is anchored
bottom and right. When place the control on the form all is fine, I dock it
to fill and then resize the form and the last button remains anchored bottom
and right. I then build the project / or run the project and all is OK.
Now I changed the control to accept constituent controls in the form
designer where an instance of the user control exists.
i.e
Imports System.ComponentModel
Imports System.ComponentModel.Design

<Serializable(),
Designer("System.Windows.Forms.Design.ParentContro lDesigner,System.Design",
GetType(IDesigner))> _

Public Class myUsercontrol

Inherits System.Windows.Forms.UserControl

etc

The control on the form can now have textboxes dropped into it, great.....
until you either build or run the form!! The bottom that was anchored now
moves to it's original place on the form, i.e the location it has in the
usercontrol. The anchoring still works, but because the form is bigger than
the usercontrol at design-time, the button is anchored about two inches from
the bottom left of the form, and not down in the corner.

So a lot of investigating later, I decided to replace Resumelayout(false)
with true and it works perfectly!!! Only problem is any changes to the user
control or form will remove this change from the form designer code and it
goes back to false. I guess rightfully so!! but that's also debateable.
This problem is really annoying and I know no way around it. Any help is
GREATLY appreciated.

I am using VS 2003 7.1.3088, .NET framework 1.1.4322. Same problem exists
on W2K prof and WinXP Prof.

Many thanks,

Karl


Nov 20 '05 #1
0 1134

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

Similar topics

0
by: karlodb | last post by:
Hi all, I've been struggling with some strange VB behaviour for the last two days. I have created a usercontrol and placed two buttons in it. One is anchored bottom and right. When place the...
0
by: lc | last post by:
I use a series of UserControl that get dynamically created and (all) docked (fill) on one form panel. Problem is that I have to call UserControl.BringToFront() more than once to get it to show....
9
by: Richard Brown | last post by:
Can anyone give me a good argument one way or another? I have an 'address' set of fields that are used in various situations (a client has an address, a destination has an address, etc). These...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
2
by: Steve | last post by:
This is a weird one. I have a series of "SmartParts" which are CAB (Composite Application Block) Views which are finally just UserControls (99% of the time) Anyway, I layout my UserControl in...
0
by: Rune Jacobsen | last post by:
Hi guys, Using C# and Visual Studio 2003, I want to build a control that contains a large square area for visual display of some data that will most likely not fit on a normal PC screen (perhaps...
1
by: TheSteph | last post by:
Hi ! I would like to create a UserControl that act as a « Collapsible Panel ». So I have a UserControl with two panels : a "Header panel" at the top, and a "Container Area Panel"...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
3
by: dave | last post by:
I have a propery sheet inside of a splitview container. Unfortunately, it stuff the first tab right up into the top left corner when docked, which doesn't look good (I'd prefer border). According...
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...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.