120dpi setting for windows and dynamic added controls

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello,

I have the following:
..net 1.1 application (must be), on windows xp
one form (via designer).
one userControl with labels (via designer), BUT the usercontrol is NOT added
to the form via designer.

Now at runtime the userCtrl01 is added in the form:

private void btnNext_Click(object sender, System.EventArgs e)
{
MyUserCtrl userCtrl01 = new MyUserCtrl();
userCtrl01.Location = .............;
userCtrl01.Size = .............;
this.Controls.Add(userCtrl01);
this.ResumeLayout(true);


}

All this is done when windows xp has setting to 96dpi.
All works fine.

Now I change windows xp to 120dpi.
All other forms (made by designer) work fine with 120dpi.
But this form with dynamic added userCtrl does not.
First: The usercontrol is not set to the right size; the fonts are larger as
it's right for 120dpi, but the size of the userctrl is the same as at 96dpi.
If I now make a trick to get this, it works, but then the labels in the
usercontrol have not the right size.

What is to do, that all work with 96dpi AND 120dpi.
I cannot seet this at development time because it's a product which runs on
different systems.

Thank You for any help.
Rolf Welskes


.



Relevant Pages

  • Hide properties from Designer
    ... I have the problem that the windows Forms designer always initilizes *all* ... properties of my usercontrol with default values, but that is not what I ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Deriving - .NET example
    ... The example I'm going to give is based on the .NET Windows Forms, but it's really a design related question not related to technology. ... A Form class has fairly large interface which can be used to manipulate the window. ... When designing custom form via MS Visual Studio designer, the corresponding C# code is designed which uses the aforementioned class Form and its interface to achieve the look created in the designer. ...
    (comp.object)
  • RE: Update API
    ... rather than the user being forced to go to Windows ... Your company would have to have a server to host ... parameters like "disk" space, security, required design restrictions, write ... disk and registry mean that the designer also has to manage XPE-specific ...
    (microsoft.public.windowsxp.embedded)
  • Re: 2005 vs. 2003
    ... I don't like the Windows Forms Designer Generated code being placed in form1.vb in a 2005 program. ... Overall I'm happy upgrading works and works very well but it has things that irritate me like not converting the 2003 Windows Forms Designer Generated code to the new 2005 way of doing things. ... The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Visual Studio IDE Problem with Compact Framework 3.5
    ... forms designer if I use CF 2.0. ... Windows Forms Designer' is checked. ... 3, MS Windows SDK for PPC 2002, Microsoft Pocket PC 2003 SDK, Windows ... There is a screenshot of mentioned Visual Studio environment at the ...
    (microsoft.public.dotnet.framework.compactframework)