471,327 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,327 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 1514
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Donald Xie | last post: by
reply views Thread by Phl | last post: by
2 posts views Thread by adiel_g | last post: by
reply views Thread by rosydwin | last post: by

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.