I tried to make application where is one form with Panel control where id displaying user control (page). This page can have button when can call other page which is display to parent panel control. Main from have some BarButton control for quick choose.
Problem is with button on pages. When I moving among pages, is makes multiple calling same pages (it is increase). Why I tried to call helped by events and delegates to main frame but without any improve.
Cut of main form:
PageType is main PageControl (for future common parts)
Code:
public partial class pageType : DevExpress.XtraEditors.XtraUserControl
{
public bool DiableTextInput = false;
public MainWind parent;
public pageType()
{
InitializeComponent();
}
}
Page Login one of derived from pageType
Code:
public partial class pgLogin : TW_HMI.page.pageType
{
public pgLogin()
{
InitializeComponent();
}
private void labelControl2_DoubleClick(object sender, EventArgs e)
{
pgMain pg = new pgMain();
parent.SwitchPage(pg, null);
}
}
Page Login one of derived from pageMain
Code:
public partial class pgMain : TW_HMI.page.pageType
{
public pgLogin()
{
InitializeComponent();
}
private void labelControl1_DoubleClick(object sender, EventArgs e)
{
pgOp1 pg = new pgMain();
parent.SwitchPage(pg, null);
}
private void labelControl2_DoubleClick(object sender, EventArgs e)
{
pgLogin pg = new pgLogin();
parent.SwitchPage(pg, null);
}
}
I was any better concept ?
Thank for any ideas.
Last edited by pawl; March 29th, 2012 at 04:51 AM.
Sorry I didn't get your idea. Maybe zip what you already have and post the zupped code Maybe when I test your code I'll get the idea behind that code.
Is the maonForm an MDI window? what isthe forms loaded in the FormLoad event is this a child window?
And BTW please use code Tags
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ? My latest articles : Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
You are addiong a new delegate everytime when you are loading that form "" You never remopve them. So this delegate is done more and more and more as longer the program is used and the panels are changed
I have added the cirrected file now when a button is clicked the buttonsel only fires one time
Last edited by JonnyPoet; March 29th, 2012 at 05:13 PM.
Jonny Poet
To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
If anyone felt he has got help, show it in rating the post.
Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ? My latest articles : Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.