|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionMany times customer says 'we need Windows application which works like browser’. This article describes how to make WinForms Application which mimics a Browser. Because Tiny WinForms Application Framework is so long a name, I have called it JUJU. What does the code do?
How to startWhen you start to build a new Windows Application and it’s layout looks like Browser, include these files to our project and start to create the new Forms. You can jump from any form to another and the framework remembers how to go backwards or forwards. There is one main class that handles the behaviour of Browser. It is called AppManager.Show (new Form1, “”) //new stack, no arguments
AppManager.Show (new Forms, this, arguments) //same stack, with arguments
Every Form has it’s own Main ideas, JujuMain function is public class Start
{
public Start() {}
[STAThread]
static void Main() {
AppManager.Show(new Home(), "");
Application.Run();
}
}
Expand your public class Form1 : System.Windows.Forms.Form, IForm{..}
Add publicForm1() {
InitializeComponent();
FormManager frmManager = new FormManager( this);
}
Remember also to Implement all When you want to create new window just call AppManager.Show( new Form1(), this, argsOUT);
If the new Form is in the middle of stack when you call function publicstatic void Show(Form newForm, Form oldForm, string args) {
Node current = Activate(oldForm);
if (current.Right != null) Remove(current.Right.Value, true);
Node node = new Node(newForm, current, null);
current.Right = node;
nodes.Add(node);
InitForm(newForm, oldForm, args);
ShowHide(newForm, oldForm);
current = null;
}
Bugs and commentsIf you have any ideas how to develop this idea don’t hesitate to contact me, dathava@jippii.fi. I would be pleased if someone can give me me ideas how to develop this idea further. Maybe there are better ways how to handle events. So if you invent any new features, let me know. Juju means a trick in Finnish. What is needed?Common Keyboard and Menu handlers.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||