NForm in Panel on XP


Author
Message
Brad Swearingen
Brad Swearingen
Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)Forum Guru (53 reputation)
Group: Forum Members
Posts: 53, Visits: 3
I've been trying to take an NForm and get it to work inside a docking panel (using Nevron 11.1.17.12).  Things work as expected on Win7 but I'm having issues on WinXP.  I've got code like the following which modifies an existing NForm to prepare it:
 

private void prepFormForPanel(NForm frm)

{

frm.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;

frm.FormBorderStyle = FormBorderStyle.None;

frm.TopLevel = false;

frm.MaximizeBox = false;

frm.MinimizeBox = false;

frm.StartPosition = FormStartPosition.Manual;

frm.Location = new Point(0, 0);

// FrameAppearance has to be set for XP to not show border

NFrameAppearance frameAppearance = new NFrameAppearance();

frameAppearance.BottomBorder = 0;

frameAppearance.LeftBorder = 0;

frameAppearance.RightBorder = 0;

frameAppearance.CaptionHeight = 0;

frameAppearance.ButtonSize = Size.Empty;

frm.FrameAppearance = frameAppearance;

frm.Visible = true;

}

On XP, though the frame is not showing (due to the frm.FrameAppearance change which I found via the forum on another thread) the NForm layout is not utilizing the space where the frame was completely.  There's lots of extra white space on the bottom and the right inside the panel instead of the controls on the form filling the space through their anchor layout property.
 
If I instead use a Form (instead of an NForm) I don't have this problem but I lose the skin/palette/frame customizations that the NForm receives.
 
What's the recommended properties on an NForm being added to a docking panel for any OS?
 

 


Reply
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Brad,

The form frame appears despite your FrameAppearance settings because when skin is applied the form has its skin related predefined FrameAppearance, which has priority over your custom defined skin.

To overcome this you need to create and then host into NDockingPanel new Form type which derives from NForm and overrides CurrentFrameAppearance property as follows:

public class MyForm : NForm
{
   public MyForm()
   {
      m_CustomFrameAppearance = CurrentFrameAppearance;
   }

   public override NFrameAppearance CurrentFrameAppearance
   {
      get
      {
         return m_CustomFrameAppearance;
      }
   }

   public NFrameAppearance CustomFrameAppearance
   {
      get
      {
         return m_CustomFrameAppearance;
      }
      set
      {
         m_CustomFrameAppearance = value;
      }
   }

   NFrameAppearance m_CustomFrameAppearance;
}

Then all you need is to set this new CustomFrameAppearance to the desired one.

Regarding NListView scroll bars problem. The way of the system scroll bars appears in Windows 7 does not allow us to paint correctly our scroll bars.
Unfortunately, the only advice regarding this problem I can give you is to use default scroll bars by setting UseCustomScrollBars to false.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search