[Guide] How to Create a Graphic User Interface (GUI)

07/08/2011 09:45 S/W#31
Quote:
Originally Posted by Fаng View Post
Awesome! =]
Can I see a picture?
picture in Attachments :)
Ty for guide :)
07/08/2011 09:48 BaussHacker#32
Quote:
Originally Posted by S/W View Post
picture in Attachments :)
Ty for guide :)
Why do you attrach a picture in a .rar and not upload it to ex. min.us ?
07/08/2011 09:51 Spirited#33
Quote:
Originally Posted by S/W View Post
picture in Attachments :)
Ty for guide :)
[Only registered and activated users can see links. Click Here To Register...]
That's what I used for my guide's pictures.
07/08/2011 09:57 S/W#34
[Only registered and activated users can see links. Click Here To Register...]
07/08/2011 12:09 Spirited#35
Quote:
Originally Posted by S/W View Post
(picture)
Very cool. Try looking at the properties of the main window. You can change the icon, name of the GUI, etc. all from there.

Quote:
Originally Posted by zTek View Post
Couldn't you just call the main() void in that certain void.

Program.Main();

Then it will load everything like the console does?
Never call Program.Main().
The main thread starts when the program starts. It looks for Main() and executes that void (like any thread would do). Additional threads need to be defined in Main() and started from that original main thread. What the gui is doing is making a separate thread to run the gui. All server related functions should be left on the main thread or another thread (other than the GUI thread). I hope that answers your question. I'm not sure what you were really asking.
08/01/2011 23:22 _DreadNought_#36
I noticed(for me anyway) button's and shit didn't look right.
So upon loading the GUI I just added:
Code:
        protected static void LoadForm()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Server());
        }
Thanks for that fang, I already knew how to do some of it but loading on a new thread and the Cross-Threading violation exception bypass helped too. It's amazing how I didnt know it was that easy(I was manually creating a new thread "Thread r = new Thread") hehe.

+K
08/01/2011 23:47 Spirited#37
Quote:
Originally Posted by _DreadNought_ View Post
I noticed(for me anyway) button's and shit didn't look right.
So upon loading the GUI I just added:
Code:
        protected static void LoadForm()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Server());
        }
Thanks for that fang, I already knew how to do some of it but loading on a new thread and the Cross-Threading violation exception bypass helped too. It's amazing how I didnt know it was that easy(I was manually creating a new thread "Thread r = new Thread") hehe.

+K
If you want to enable visual styles that's fine... but I would take that off when you're putting it on your vps (since they have limited graphic power). It might cut into your performance a little if you move the window around or open new ones to manage something.
08/03/2011 01:03 BioHazarxPaul#38
Umm didnt you already go over gui's and all this before.. x_x
08/03/2011 05:48 Spirited#39
Quote:
Originally Posted by BioHazarxPaul View Post
Umm didnt you already go over gui's and all this before.. x_x
Yah. This is a better guide though.
And this time I can explain it all and defend my work. =p
08/03/2011 10:50 BaussHacker#40
There is another way to do it, the real way.

Using System.Drawing etc.
08/03/2011 18:53 Spirited#41
Quote:
Originally Posted by BaussHacker View Post
There is another way to do it, the real way.

Using System.Drawing etc.
If you want to use that method then by all means, go ahead.
There are many different ways to doing this.
08/03/2011 20:18 BaussHacker#42
Quote:
Originally Posted by Fаng View Post
If you want to use that method then by all means, go ahead.
There are many different ways to doing this.
With my way you can draw on objects.
08/03/2011 21:10 Spirited#43
Quote:
Originally Posted by BaussHacker View Post
With my way you can draw on objects.
I can see how that might be useful in other applications, but we're just making a GUI for a Conquer Online private server. We're not trying to make something that uses graphics that much... in fact, the way that you're describing would lead to poorer performance.
08/04/2011 00:00 BaussHacker#44
Quote:
Originally Posted by Fаng View Post
I can see how that might be useful in other applications, but we're just making a GUI for a Conquer Online private server. We're not trying to make something that uses graphics that much... in fact, the way that you're describing would lead to poorer performance.
Would not lead to poor performance. It will make no difference at all, other than how it looks, it of course depends on if you do it 'right'. And true at that it's just for a COPServer.
08/04/2011 00:39 Spirited#45
Quote:
Originally Posted by BaussHacker View Post
Would not lead to poor performance. It will make no difference at all, other than how it looks, it of course depends on if you do it 'right'. And true at that it's just for a COPServer.
Traditionally, System.Drawing is used for programs that require heavy graphics or animations. Adding those kind of features to a GUI would be idiotic for a project like this... I would just stick with making a Form.