473,789 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loading Controls Programmaticall y

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.SuspendLa yout();

// Loads a number of ListViews depending on Panel size
LoadListViewCon trols(Panel.Siz e);

Panel.ResumeLay out();

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 1589
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**@noplaceli kehome.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.SuspendL ayout();

// Loads a number of ListViews depending on Panel size
LoadListViewCo ntrols(Panel.Si ze);

Panel.ResumeLa yout();

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
1393
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?) In particular, I'm looking for some documentation on the functions for creating and manipulating those controls programmatically - besides and much like the ones I'm using now:
1
3025
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 access to the methods and properties from the Page_Load, no problem there. But as soon as I want access to the user control from another procedure on the same page, I get the next error message: "Object reference not set to an instance of an...
8
4280
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 which is related to the repeater. In the code shown below, if I call Repeater1.Controls.Count in the OnInit (the code fragment was highlighted in yellow) , the viewstate for the repeater will be lost during the postback. You can re-produce this...
8
4317
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 button at runtime: //----- Code snippet protected System.Web.UI.WebControls.PlaceHolder ImageHolder; private void Page_Load(object sender, System.EventArgs e)
0
1514
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 button. The controls which I know I will need at page init gets their viewstate contents back properly per postback. However I am having a lot of troubles with keeping the contents of usercontrols which are
4
5056
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);"); body.Attributes.Add("onKeyUp", "highlight(event);"); Some of my forms have a great many text box controls that I want to highlight.. I would much rather that ASP.NET do the work of looping through all text boxes and applying these two attributes.
0
1320
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 fine; they maintain their state as expected. Cool and groovy. However, since CreateChildControls() is called before the method that responds to the button click, say AddControl_Click(), for some reason, this control does not maintain its
1
1843
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 asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
3
2648
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 CssClass to them, or programmatically making the Visible/not Visible. If applied to a containing page, such a function would traverse all user controls statically and dynamically placed on the page, correct? Thanks,
2
7181
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 call the webform. I could possibly have 10 user controls in this page and I would not want all of them to load up. I would like to control which user control loads up. I have tried placing each user control in a separate placeholder and then...
0
9663
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
10193
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
10136
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
9016
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
7525
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
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.