473,394 Members | 1,554 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.

Loading Controls Programmatically

Hi,

I have created myUserControl that contains a Panel. The panel is
loaded dynamically with a number of ListViews. The number depends on
the size of the form (therefore the size of the panel which is
anchored to resize when form is resized).

Basically, I load my ListView as:

Panel.SuspendLayout();

// Loads a number of ListViews depending on Panel size
LoadListViewControls(Panel.Size);

Panel.ResumeLayout();

If I drag another window over my form, the ForeColor and Font
properties of my ListViews take over containers values.

So my ListViews which had programatically set ForeColor and Font to
say Red, Arial will change to panels properties which are say MS Sans
Sarif, Black.

Same happens when form is maximized - I remove and reload ListViews
but those that are in the area of the form before maximize get
properties set correctly (Red, Arial). ListViews that are in the area
of form that was not visible before maximize, get ForeColor and font
from container (Black, Sarif).

How to fix this?

Any Help Will Be Appreciated,

_dino_
Jan 20 '06 #1
1 1566
For those interested, I have found out that this problem is rather an
IDE issue than coding issue. In my case, this happens when I run my
application from IDE. When I run the .exe file, this does not occur.

_dino_

On Fri, 20 Jan 2006 17:05:01 GMT, Dino Buljubasic
<di**@noplacelikehome.com> wrote:
Hi,

I have created myUserControl that contains a Panel. The panel is
loaded dynamically with a number of ListViews. The number depends on
the size of the form (therefore the size of the panel which is
anchored to resize when form is resized).

Basically, I load my ListView as:

Panel.SuspendLayout();

// Loads a number of ListViews depending on Panel size
LoadListViewControls(Panel.Size);

Panel.ResumeLayout();

If I drag another window over my form, the ForeColor and Font
properties of my ListViews take over containers values.

So my ListViews which had programatically set ForeColor and Font to
say Red, Arial will change to panels properties which are say MS Sans
Sarif, Black.

Same happens when form is maximized - I remove and reload ListViews
but those that are in the area of the form before maximize get
properties set correctly (Red, Arial). ListViews that are in the area
of form that was not visible before maximize, get ForeColor and font
from container (Black, Sarif).

How to fix this?

Any Help Will Be Appreciated,

_dino_


Jan 23 '06 #2

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

Similar topics

1
by: wASP | last post by:
Hello everyone, I'm wondering if anyone knows of any good documentation on dynamic Loading of ASP.NET User Controls using the LoadControl Method? ( ... or with any other method in general?) ...
1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
0
by: Phl | last post by:
Hi, I am trying to create an webform which loads usercontrols dyanamically. I know exactly what to load for some of these controls but for some, I dont want to load it until the user has press a...
4
by: | last post by:
I have a "form field highlight" javascript that I've added to some of my ASP.NET forms using the following syntax: body.Attributes.Add("onClick", "highlight(event);");...
0
by: mark.norgate | last post by:
Hi I'm having a problem in adding controls to a page programmatically in response to a button click. Composite user controls added programmatically in the CreateChildControls() method work...
1
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and...
3
by: Ken Fine | last post by:
I'm interested in programmatically manipulating groups of ASP.NET controls by type. Can someone suggest code for the following? Loop through, say, all label controls on a page, and assigning a...
2
by: adiel_g | last post by:
I added a user control to a webform in Asp.net 2.0. I am also adding several other user controls to this webform. Now I am trying to find a way to stop the user controls from loading up when I...
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
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
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...
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.