473,698 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to embed LinsUI Layout Manager 2.1 into an existing project

1 New Member
1. Locate the Form which is a container for multiple-document interface (MDI) child forms. Change its base class from Form to LinsUI.FlexMDIF orm. For example, if MyMDIForm class is your MDI container,
// The old code
public partial class MyMDIForm : Form
{
}

// The new code
using LinsUI;
public partial class MyMDIForm : LinsUI.FlexMDIF orm
{
}

2. Open Program.cs file, set the default path for the layout settings file, the default path for the help file, and the default path for the icons.
[STAThread]
static void Main()
{
// Get the entry assembly
Assembly assem = Assembly.GetEnt ryAssembly();
// Get the application location
string csAssemName = assem.Location;
// Get the applicationb name
string csProjectName = assem.GetName() .Name;
// Get the path where the application is located
string csDirectory = Path.GetDirecto ryName(csAssemN ame);
int nIndex = csDirectory.Las tIndexOf("Sampl es");
string csSampleDirecto ry = csDirectory.Sub string(0, nIndex) + "Samples\\" ;

// Set the default path for saving the layout settings file,
FlexUISettings. AppSettingPath = Path.Combine(cs Directory, csProjectName);

// Set the default path for get the Help file
FlexUISettings. DefaultHelpFile Path = Path.Combine(cs SampleDirectory , "Helps"); ;

// Set the default path for icons
FlexManager.Def aultIconsPath = Path.Combine(cs SampleDirectory , "Icons");

Application.Ena bleVisualStyles ();
Application.Set CompatibleTextR enderingDefault (false);
Application.Run (new MDIForm());
}

3. Change the base class of all child forms from Form to LinsUI.FlexForm , and assign every form a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and FlexConstants.m _nUserDefinedCo ntrolEndID. For example,
// The old code
public partial class MyChildForm : Form
{
public MyChildForm()
{
InitializeCompo nent();
}
}

// The new code
using LinsUI;
public partial class MyChildForm : LinsUI.FlexForm
{
public MyChildForm ()
{
InitializeCompo nent();

// Assign a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and
// FlexConstants.m _nUserDefinedCo ntrolEndID
this.ID = FlexConstants.m _nUserDefinedCo ntrolStartID + 1;
}
}

Inside InitializeCompo nent(), assign the dock style.
using LinsUI;
private void InitializeCompo nent()
{
//
// your existing code
//

// Assign the dock style.
this.FlexDock = LinsUI.FLEX_DOC KING_ALIGN.LEFT ;
}

You can create the derived form any where as following,
public partial class MyMDIForm : LinsUI.FlexMDIF orm
{
public MyMDIForm ()
{
SuspendLayout() ;
InitializeCompo nent();

// Create a child form.
MyChildForm myChildForm = new MyChildForm();
// Show the form.
myChildForm.Sho wForm();

ResumeLayout( false );
PerformLayout() ;
}
}

Note: You do not need to assign a parent to the derived form. So remove all the code like this.Controls.A dd( myChildForm ).

4. Change the base class of all panels from Panel to LinsUI.FlexPane l, and assign the panel a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and FlexConstants.m _nUserDefinedCo ntrolEndID. For example,
// The old code
public partial class MyPanel : Panel
{
public MyPanel()
{InitializeCompo nent();
}
}

// The new code
using LinsUI;
public partial class MyPanel : LinsUI.FlexPane l
{
public MyPanel ()
{
InitializeCompo nent();
// Assign a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and
// FlexConstants.m _nUserDefinedCo ntrolEndID
this.ID = FlexConstants.m _nUserDefinedCo ntrolStartID + 2;
}
}

Inside InitializeCompo nent(), assign the dock style.
using LinsUI;
private void InitializeCompo nent()
{
//
// your existing code
//

//Assign the dock style.
this.FlexDock = LinsUI.FLEX_DOC KING_ALIGN.RIGH T;
}

You can create the derived panel any where as following,
public partial class MyMDIForm : LinsUI.FlexMDIF orm
{
public MyMDIForm ()
{
SuspendLayout() ;
InitializeCompo nent();

// Create a panel.
MyPanel myPanel = new MyPanel();
// Show the panel.
myPanel.ShowPan el();

ResumeLayout( false );
PerformLayout() ;
}
}

Note: You do not need to assign a parent to the derived panel. So remove all the code like this.Controls.A dd( myPanel ).

5. Change the base class of all toolbars from ToolStrip to LinsUI.FlexTool Strip, and assign the toolbar a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and FlexConstants.m _nUserDefinedCo ntrolEndID. For example,
// The old code
public partial class MyToolStrip : ToolStrip
{
public MyToolStrip()
{InitializeCompo nent();
}
}

// The new code
using LinsUI;
public partial class MyToolStrip : LinsUI.FlexTool Strip
{
public MyToolStrip ()
{
InitializeCompo nent();
// Assign a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and
// FlexConstants.m _nUserDefinedCo ntrolEndID
this.ID = FlexConstants.m _nUserDefinedCo ntrolStartID + 3;
}
}

Inside InitializeCompo nent(), assign the dock style.
using LinsUI;
private void InitializeCompo nent()
{
//
// your existing code
//

// Assign the dock style.
this.FlexDock = LinsUI.FLEX_DOC KING_ALIGN.RIGH T;
}

You can create the derived toolbar any where as following,
public partial class MyMDIForm : LinsUI.FlexMDIF orm
{
public MyMDIForm ()
{
SuspendLayout() ;
InitializeCompo nent();

// Create a toolbar.
MyToolStrip myToolbar = new MyToolStrip();
// Show the toolbar.
myToolbar. ShowToolStrip() ;

ResumeLayout( false );
PerformLayout() ;
}
}

Note: You do not need to assign a parent to the derived toolbar. So remove all the code like this.Controls.A dd( myToolbar ).

6. Change the base class of all menu bars from MenuStrip to LinsUI.LinsMenu Strip, and assign the menu bar a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and FlexConstants.m _nUserDefinedCo ntrolEndID. For example,
// The old code
public partial class MyMenuStrip : ToolStrip
{
public MyToolStrip()
{InitializeCompo nent();
}
}

// The new code
using LinsUI;
public partial class MyMenuStrip : LinsUI.LinsMenu Strip
{
public MyMenuStrip()
{
InitializeCompo nent();
//Assign a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and
//FlexConstants.m _nUserDefinedCo ntrolEndID
this.ID = FlexConstants.m _nUserDefinedCo ntrolStartID + 3;
}
}

Example 1:
You can assign the derived menu bar as the main menu as following,
public partial class MyMDIForm : LinsUI.FlexMDIF orm
{
public MyMDIForm ()
{
SuspendLayout() ;
InitializeCompo nent();

// Create a menu bar.
MyMenuStrip myMenubar = new MyMenuStrip();
// Show the menu bar.
myMenubar. ShowMenuStrip() ;
// Set myMenubar as the main menu.
SetMenuStrip( myMenubar );

ResumeLayout( false );
PerformLayout() ;
}
}

Example 2:
Or you can assign the derived menu bar as a panel’s menu bar,
public partial class MyPanel : LinsUI.FlexPane l
{
public MyPanel()
{
SuspendLayout() ;
InitializeCompo nent();
// Assign a unique ID which should be between FlexConstants.m _nUserDefinedCo ntrolStartID and
// FlexConstants.m _nUserDefinedCo ntrolEndID
this.ID = FlexConstants.m _nUserDefinedCo ntrolStartID + 1;

// Create a menu bar.
MyMenuStrip myMenubar = new MyMenuStrip();
// Show the menu bar.
myMenubar. ShowMenuStrip() ;
// Set myMenubar as the menu bar of this panel.
SetMenuStrip( myMenubar );

ResumeLayout( false );
PerformLayout() ;
}
}

Note: You do not need to assign a parent to the derived menu bar. So remove all the code like this.Controls.A dd( myMenubar ).
After you do all of above, you are ready to use the LinsUI Layout Manager.
Dec 23 '10 #1
0 3829

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1672
by: Greg Chu | last post by:
Hi, on the start page of the IDE, you see "open an existing project". Currently I only have 4 existing project listed. Is there a place that I can change to list more existing projects? Thanks! Greg
0
2637
by: Andrew Fedoniouk | last post by:
Announce: Lightweight HTML forms layout manager and browser component. http://HtmLayout.com Latest version of HtmLayoutSDK contains sources of wrapper for .NET (C#) Andrew Fedoniouk. http://terra-informatica.org
4
6389
by: Kerry Sanders | last post by:
I was playing around with a new Windows form yesterday. I wanted to drop two panels on the form. The first would be set Dock=Top. The second would be set Dock=Fill. So, I dropped the first panel and set its Dock property to Top. I then dropped the second panel on the form and set its Dock property to Fill. Holy disappearing panels, Batman. The second panel filled the entire form hiding the first panel. So, when I dropped my grid...
5
7762
by: Kevin Buchan | last post by:
I came in today and tried to edit a project that I was working with, locally, at the tail end of last week. This web project was created, hosted, and only edited locally. I truly cannot remember anything that I installed/changed on my workstation that could have goofed up my IIS, but I simply cannot get VS 2003 to be able to open an exiting or create a new web project. I have tried the following: * Uninstall and Reinstall IIS...
2
2476
by: ed d | last post by:
Hi, When I try to create a new web project, or "add existing project from web" or "open from source control" i'm prompted for a URL and type in a virtual directory. -- with "add project from web" i just get a file dialog box in "my documents" and browsing to the right project folder doesn't work.
2
414
by: Joe Wedel | last post by:
I have a Solution with 4 Projects, one of which is not loading. I get the error message: Microsoft Development Environment Unable to read the project file 'CouncilAgenda.vbproj'. The project file '' has been renamed or is no longer in the solution. I removed the project from the solution, then tried to add it back in, but I get the message above. The .vbproj file
0
1346
by: newjazzharmony | last post by:
I'm working in Visual Studio 2003 and I'm trying to add a web project to a solution. When I right-click on the solution and select "Add Existing Project you want to add the project from:" that is prepopulated with "http://localhost." When I click "OK," the "Add Existing Project" dialog comes up with the "localhost" folder selected. Inside this folder, I am expecting to see the "csproj" files inside my "inetpub\wwroot" folder, but...
0
614
by: Narasimham | last post by:
Hi, I was able to successfully create a new project using the devenv command line arguments. I did devenv /command np and then specified the name of the project and its location in the
2
3171
by: trullock | last post by:
Hi, Ive installed the ASP.NET AJAX extensions and ive set up a simple example, however its not doing anything asynchronously, its always posting back... Could this be something to do with the fact ive added it to an existing project not an "asp.net ajax enabled project"? If so, whats the difference and how do i make my existing project the
3
1718
by: nehamaru | last post by:
which layout manager honours the preferd component size ? i am confuing it is border or flow layout ?
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.