Profile Picture

Rendering difference?

Posted By Miles Thornton 14 Years Ago
Author
Message
Miles Thornton
questionmark Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)Junior Member (17 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 17, Visits: 1

I have a winforms app using the Nevron controls (which I like btw) but I am noticing a very odd behavior. I believe that there's likely a setting for this and I'd appreciate it if someone could point out what I'm doing wrong...

The issue is that the Nevron Edit Box Controls seem to render the Editcontrol differently! The "left" property appears to be moved significantly to the left when running on the server!

The issue is best seen in the two attachments. One, running on my PC and the other running in my PROD environment, running on a windows server accessed via Remote Desktop...

Please help! This application is supposed to go live on Monday!



Attachments
Running on my PC.jpg (227 views, 78.00 KB)
Running on Server.jpg (203 views, 50.00 KB)
Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hello Miles,

 

From the images you posted it looks like you have different DPI settings on both machines.

Unfortunately some of our UI controls currently doesn’t draw itself correctly when the DPI is set to more than 96.

One other customer with the similar problem suggested a workaround that may be is suitable for you too.

 

 

NForm form = new NForm();

 

//Depending of the AutoScaleMode property of the form you can evaluate scale factor as follows

if (form.AutoScaleMode == AutoScaleMode.Font)

{

      if (form.AutoScaleDimensions.Width > 6)

      {

            m_IsLargeFont = true;

            m_ScaleFactorX = form.AutoScaleDimensions.Width / 6;

            m_ScaleFactorY = form.AutoScaleDimensions.Height / 13;

      }

}

if (form.AutoScaleMode == AutoScaleMode.Dpi)

{

      if (form.AutoScaleDimensions.Width > 96)

      {

            m_IsBiggerDPI = true;

            m_ScaleFactor = form.AutoScaleDimensions.Width / 96;

      }

}

 

After the scale factors are evaluated you should set the size of the entry box:

 

private void ScaleEntryBox(NEntryBox entryBox)

{

      if (m_IsLargeFont)

      {

            int height = (int)(entryBox.Height * m_ScaleFactorY);

            int width = (int)(entryBox.Width * m_ScaleFactorX);

            entryBox.Height = height;

            entryBox.Width = width;

      }

      if (m_IsBiggerDPI)

      {

            int height = (int)(entryBox.Height * m_ScaleFactor);

            int width = (int)(entryBox.Width * m_ScaleFactor);

            entryBox.Height = height;

            entryBox.Width = width;

      }

}

 

I hope this works for you.

Please, let us know if the problem persist.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic