473,493 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

windows forms

27 New Member
Hi !

What is the common and recommended way for writing GUI for a c# project ? Is it windows forms or not ? If so, does it have limitations (like number of buttons )?
Is it simple to implement all the GUI for a commercial project using winforms ?
Thanks
Apr 10 '11 #1
5 1142
hype261
207 New Member
Windows forms or WPF currently is the standard for writing a commercial project using C#. I have never heard of any limitations on the number of controls you can have on your forms, but I believe it would be limited to the amount of memory and processing speed your target computer.

That being said in OO programming there is a term called the Single Responsibility Principal and I believe this principal also applies to any forms you design. Don't over crowd them with tons of buttons and controls. You will confuse your users and make your forms unmodular.
Apr 11 '11 #2
GaryTexmo
1,501 Recognized Expert Top Contributor
Actually there is a limit for the number of controls you can put on a form. It's an operating system restriction and is around 10 000 controls (sometimes higher, sometimes lower), but you can change it at the OS level if you want (not really recommended). The limitation is actually the number of handles the operating system supports, and every control gets its own handle. When you reach this limit you get an exception.

Error creating window handle.
I made a tester a while ago when I discovered the issue, you're welcome to play around with it. The executable doesn't work, so just copy/paste the code into a new project.

If nothing else, this will let you find out roughly where your OS limit is ;)

http://members.shaw.ca/gtexmo/Progra.../HandleTester/

I did some quick testing because I haven't played with it in a while and it looks like once you hit this limit, your program can't create any new handles, but the OS still can. I'm not really sure how it works, this was a couple years back, but you can look into it.

Anyway, you should never actually hit this limit. As hype said, you shouldn't crowd your form with too much stuff. If you find yourself getting that high on the control count, you might want to start thinking of alternative solutions.
Apr 11 '11 #3
gilit golit
27 New Member
Thanks
Thats more then enought
I wanted to know that Winform will not cause me troubles.
What is the diff between winform and WPF ?
Apr 11 '11 #4
gilit golit
27 New Member
Thanks

What is the diff between winform and WPF ?
Apr 11 '11 #5
hype261
207 New Member
WPF stands for Windows Presentation Foundation and came out with Visual Studio 2008. It is the "newer" way to build C# applications. Basically all your design of the forms is in xaml which is very similar to xml. With WPF it is a lot easier to design very visually interesting forms. With WinForms you could probably do the same thing, but you are going to have to program it all yourself.
Apr 11 '11 #6

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

Similar topics

2
3704
by: Greg Bacchus | last post by:
Hi, I'm getting an exception that really has me stumped. It's sporadic at best, it's only happened a handful of times. This particular time it happened when the user pressed 'Alt-S' to save the...
15
3836
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
6
2524
by: Ayende Rahien | last post by:
Excetremely annoying problem, I've an application with a long startup time. So I created another form with my logo in it to as a splash screen. The splash screen is run from another thread and is...
4
464
by: Bilo | last post by:
I have a Windows Forms Class MainGUI I have declared MainGUI maingui; public System.ComponentModel.Container components = new Container(); in the Class I call another class MediaDriver with...
2
5484
by: fperfect13 | last post by:
Hi, I have the folowing exception Exception : System.NullReferenceException: Object reference not set to an instance of an object. 00000019 3:30:48 PM at...
2
7774
by: Raed Sawalha | last post by:
i have a windows form(Main) with listview, when click an item in listview i open other window form (Sub) which generate the selected item from parent window in as treeview items when click any item...
8
7876
by: J.S. | last post by:
I was under the impression that frames could be used in Windows forms in earlier version of VB. However, in VB 2005 Express I don't see any such tool/control. Is SplitContainer used for this...
0
1971
by: gxl034000 | last post by:
Hi, I have been trying to use a .net Forms control in my webpage to open up an application(notepad) on the client. The control works fine when embedded in a windows form, but I keep getting a...
4
7982
by: Mo | last post by:
Hi, I am writing a console application to send a key sequence to an old clunky application on a regular interval using the windows scheduler. I can get it to work if it is a windows form...
21
3284
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
7118
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,...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
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,...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5452
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,...
0
4579
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
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...

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.