CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: csharp on windows 7 problem

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Posts
    5

    csharp on windows 7 problem

    Hi

    I have c# project that was developed on windows xp 64 and 32 bit.
    when runnign it on windows 7 it got some GUI problems, that looks bad.

    I call
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(true);
    but it does nothelp

    I was looking at the OnPaint and see there is usage of class Graphics. from this class there is usage of FillRectangle and SetClip.

    any idea how to fix it ?

    Thanks
    Rinat

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: csharp on windows 7 problem

    So, it always helps to define the problem beyond "it looks bad", but in this case I think I know what your issue is.

    This one bit me on the *** when I switched to Windows 7. The problem is DPI. The default Win7 DPI is something around 125% of Windows XP. The causes some UI layout problems. Look at this article; Creating a DPI aware application.

  3. #3
    Join Date
    Jan 2011
    Posts
    5

    Re: csharp on windows 7 problem

    Hi

    Thanks for help.
    I read this dcument. the procedures you menation there are not of c#.

    On c# i have :
    protected override void OnPaint(PaintEventArgs e)
    {
    ...
    Graphics g = e.Graphics;
    ...
    }
    and i can not change dpiX of g since it read only.
    can you gave me solution for c# ?

    thanks
    rinat

  4. #4
    Join Date
    Jun 2008
    Posts
    2,477

    Re: csharp on windows 7 problem

    I'm sorry, I linked to the wrong article. Read the first post here

    http://stackoverflow.com/questions/4...re-application

  5. #5
    Join Date
    Jan 2011
    Posts
    5

    Re: csharp on windows 7 problem

    Thanks.
    I read it and indeed i set
    this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

    but problem still happened.
    it happened on a modules list called ListControl.

    private GlacialComponents.Controls.GlacialList _ListControl;
    attached is the designer and the GlacialList .
    can you take a look and tell me if i miss any setting ?
    i was trying to play with sizes but it not help.

    thanks
    Rinat
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)