i would make a windows form in c# ?
if one of your team help me to make a perfect one
thanks for u read ......
4 Replies - 159 Views - Last Post: 05 March 2013 - 08:36 AM
Rate Topic:




1 Votes
Replies To: windows form
#2
Martyr2
Re: windows form
Posted 04 March 2013 - 11:31 PM
Yeah sure. Open up Visual Studio, create a "Windows Form Application" in the C# section. Give it a name and click ok to create the project. After it opens, go to the "Build" menu and select "Build Solution". Once that is done, click the green arrow in the toolbar.
Perfect form everyyyyyy timmmeeeee.
Perfect form everyyyyyy timmmeeeee.
#3
Anthonidas
Re: windows form
Posted 05 March 2013 - 01:38 AM
lol you forgot to append some printscreens
#4
Skydiver
Re: windows form
Posted 05 March 2013 - 07:55 AM
ROFL! Maybe it be because of the fever I have right now, but I find it hilarious that he needs help bring up a WinForm, yet he can create a Super Mario game.
#5
tlhIn`toq
Re: windows form
Posted 05 March 2013 - 08:36 AM
My standard beginner resources post - Updated JAN 2013
Plan your study route:
There are three routes people seem to take when learning programming.
- Just start trying to create programs
- Start taking apart other programs and try to figure out the language by reverse engineering
- Follow a guided learning course (school or self-teaching books)
For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.
- First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover.
- Do a dozen on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.
- Learn to plan before you type.
- THEN you start designing software with a purpose.
I don't learn from reading books: I learn by doing.
Spoiler
Total honesty here: That is either B.S., you haven't really tried, or this is the wrong career field for you so bail out now.
You can try to learn C# by dismantling snippets and googling terms - basically you can take a hit-n-miss, shotgun approach. But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language throughbanging on the keyboard experimentation - or you can learn by doing the tutorials and following a good "How to learn C#" book. There are so many great "How do I build my first application" tutorials on the web... There are dozens of "Learn C# in 21 days", "My first C# program" type books at your local book seller or even public library.
I'll tell you from experience that just fumbling around in the dark and trying to teach yourself with no guidance doesn't work. Its like stumbling across a Harrier Jump Jet and trying to teach yourself how to fly with no background in piloting: You simply lack any groundwork to start from. How can you lay out your own training course if you don't already know the material? Would you go to a university where the teacher says "I don't know any of this but we'll fumble through it together?"
Total honesty here: That is either B.S., you haven't really tried, or this is the wrong career field for you so bail out now.
You can try to learn C# by dismantling snippets and googling terms - basically you can take a hit-n-miss, shotgun approach. But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language through
I'll tell you from experience that just fumbling around in the dark and trying to teach yourself with no guidance doesn't work. Its like stumbling across a Harrier Jump Jet and trying to teach yourself how to fly with no background in piloting: You simply lack any groundwork to start from. How can you lay out your own training course if you don't already know the material? Would you go to a university where the teacher says "I don't know any of this but we'll fumble through it together?"
Newbie/Rookie said:
I have little/no programming experience but I need to write a program by Friday that does XYZ.
Spoiler
You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"
We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.
For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.
Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."
I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).
You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"
We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.
For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.
Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."
I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).
Resources, references and suggestions for new programmers.
Spoiler
Some of the tutorials below may not be in your chosen program language {C#, Java etc.} But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Free resources:
Articles that I constantly send people to - Good place to start.
Further debugging of your own code so you aren't asking others to do it for you:
The stages of asking for homework help on a forum
Thread with example WPF window using binding and a UserControl with properties
Beginner:
Martyr2's mega project ideas list is a great place to start on developmental projectst that you can learn from; rather than trying to make something complex like a game as a self-teaching tool {that never works for anyone}
I hate sending people to another site when we have such good tutorials here, but this series shouldn't be overlooked.
Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.
Intermediate:
Everyone:
Some of my common tips (some may apply more than others to your specific style):
Some of the tutorials below may not be in your chosen program language {C#, Java etc.} But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Free resources:
Spoiler
- We have a tutorials section and a Learning C# series of articles.
- MSDN Press - Free books
- There are numbers How-To videos on YouTube. Try this search: C# lesson 1
Articles that I constantly send people to - Good place to start.
- Learning C# series
- Understanding the common errors
- Bulding an application - Part 1
- Building an application - Part 2
- Quick and easy custom events
- Passing values between forms/classes ('How do I get Form1 to talk to Form1?')
- Separating data from GUI - PLUS - serializing the data to XML
Further debugging of your own code so you aren't asking others to do it for you:
Spoiler
Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on.
Writing a text file tutorial.
Reading a text file tutorial.
.Split()ing a string
Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on.
Writing a text file tutorial.
Reading a text file tutorial.
.Split()ing a string
The stages of asking for homework help on a forum
Thread with example WPF window using binding and a UserControl with properties
Beginner:
- C# learning series right here on Dream in code
- MSDN Framework Development Guide
- C# Reading list by Eric Lipert
- C# Fundamentals: Development for absolute beginners (video series)
- Build a Program Now! in Visual C# by Microsoft Press, ISBN 0-7356-2542-5 is a terrific book that has you build a Windows Forms application, a WPF app, a database application, your own web browser.
Martyr2's mega project ideas list is a great place to start on developmental projectst that you can learn from; rather than trying to make something complex like a game as a self-teaching tool {that never works for anyone}
- Visual Studio Keyboard Shortcuts
- D.I.C. C# Resource page Start here
- Intro to C# online tutorial then here...
- C# control structures then here.
- MSDN Beginner Developer video series
- MSDN video on OOP principals, making classes, constructors, accessors and method overloading
- MSDN Top guideline violations, know what to avoid before you do it.
- Design patterns as diagrams
I hate sending people to another site when we have such good tutorials here, but this series shouldn't be overlooked.
- Programming OOP in C# - Part 1
- Programming OOP in C# - Part 2
- Programming OOP in C# - Part 3
- Programming OOP in C# - Part 4
- Programming OOP in C# - Part 5
Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.
Intermediate:
- OOP design patterns
- Microsoft Events (webcasts and podcasts)
- WPF version (WPF-MVVM data binding)
- Decouple your multi-threaded work from the GUI so forms don't hang
- Working with environmental variables
- 'Why do we use delegates?' thread
- And everyone always wants to connect to a database, right out of the gate so Database tutorials right here on DIC
- C# Cookbooks
- Are a great place to get good code, broken down by need, written by coding professionals. You can use the code as-is, but take the time to actually study it. These professionals write in a certain style for a reason developed by years of experience and heartache.
Everyone:
- Microsoft Visual Studio Tips, 251 ways to improve your productivity, Microsoft press, ISBN 0-7356-2640-5 Has many, many great, real-world tips that I use all the time.
- MSDN C# Developers Center with tutorials
- Welcome to Visual Studio
- Free editions of Visual Studio 2010
- Student editions of Visual Studio
Some of my common tips (some may apply more than others to your specific style):
- Take the extra 3 seconds to rename your controls each time you drag them onto a form. The default names of button1, button2... button54 aren't very helpful. If you rename them right away to something like btnOk, btnCancel, btnSend etc. it helps tremendously when you make the methods for them because they are named after the button by the designer.btnSend_Click(object sender, eventargs e) is a lot easier to maintain than button1_click(object sender, eventargs e)
- You aren't paying for variable names by the byte. So instead of variables names of a, b, c go ahead and use meaningful names like index, timeOut, row, column and so on. You should avoid 'T' for the timer. Amongst other things 'T' is commonly used throughout C# for Type and this will lead to problems. There are naming guidelines you should follow so your code confirms to industry standards. It makes life much easier on everyone around you, including those of us here to help. If you start using the standards from the beginning you don't have to retrain yourself later.
You might want to look at some of the naming guidelines. Its a lot easier to start with good habits than to break bad habits later and re-learn.
- Don't use your GUI objects as your variable. In other words don't keep referencing TextBox4.Text everyplace. TextBox4.Text is not a variable or property. The GUI is on its own thread so as soon as you start doing multi-threading you're screwed because your worker thread can't access the GUI elements. Use properties.
- Try to avoid having work actually take place in GUI control event handlers. It is better to have the GUI handler call other methods so those methods can be reused and make the code more readable. This is also how you can send parameters rather than use excessive global variables. Get in this habit even if you are using WinForms because WPF works a lot under the idea of "commands" and this will get you working towards that. Think of each gester, control click, menu option etc. as a command to do something such as a command to SAVE. It doesn't matter where the command comes from, all sources should point at the same target to do the actual saving.
Spoiler
// All of this different triggering mechinisms call the same single [il]SavePreferences()[/il] method btnSave(object sender, eventargs e) { SavePreferences(preferencesPath); } <KeyboardShortcut control+s bound to save> <Touchscreen guesture swiping from lowerleft to upperright bound to save> SaveMenuItem(object sender, eventargs e) { SavePreferences(@"C:\prefs\test.txt"); } SaveContextMenu(object sender, eventargs e) { SavePreferences();// No parameter method overload } FormMain_Closing(object sender, eventargs e) { if (IsDirty) SavePreferences(); }
- Don't replace lines of code that don't work. Instead comment them out and put your new attempts below that. This will keep you from re-trying the same ideas over and over. Also, when you come back to us saying "I've tried this 100 different ways and still can't get it", we can actually see what you tried. So often a failed attempt is very very close and just needs a little nudge in the right direction. So if we can say "See what you did in attempt 3... blah blah" it helps a lot
Spoiler// Try #1 - May 1, 0900hrs // code // code // code // Try #2 - May 2, 1700hrs Okay, plan B. What if I do it *this* way // code // code // code // Try #14 - May 3, 0500hrs after 5 cans of RedBull. Maybe I should get some sleep. I can't think of anything else but this last idea code code code
If you are using Visual Studio you can select a block of lines and hit control+k control+c (Kode Comment) to comment it out. control+k control+u (Kode Uncomment) to uncomment a selected block.
- You have to program as if everything breaks, nothing works, the cyberworld is not perfect, the attached hardware is flakey, the network is slow and unreliable, the harddrive is about to fail, every method will return an error and every user will do their best to break your software. Confirm everything. Range check every value. Make no assumptions or presumptions.
- I strongly suggest installing VMware or some other virtualization technology on your development PC so you can create a couple virtual computers for testing. This would allow you to debug and test inside: WinXP32, XP64, Vista, Win7x32, Win7x64... etc. without having to actually have 5 physical PC's. Visual Studio will let you send the debug directly into one of these virtual machines so you can watch it operate, check its variables, see the crashes and so on just as if it were debugging on your real machine.
- This can't be stressed enough in today's world of cell phone messaging:
Don't use txt/sms/leet/T9 speak like: dnt no wut i m do-n, coz, al gud, b4, ny1, sum1, u r, and so on like this guy. Its completely disrespectful to the senior coding professionals that volunteer here to mentor you.
Spoilerdis not b d'hood dawg... You are sitting at a real keyboard with a real monitor, not a cell phone. You are not here texting your high school posse to come to your kegger after their shift at Taco Bell. You are here asking for help from senior coding professionals who graciously donate their valuable time to helping the next generation of coders with their chosen craft. Please try to show them, yourself and the industry some respect by writing at least at an eighth grade level. (IE: English not ebonics or SMS, real words, punctuation and so on). If you can't take your own problem/question seriously enough to write like an adult, then why would you expect anyone else to take it seriously?
When you write a post you are presenting yourself. Your writing style is all you have to show others who you are and what you stand for. When I see posts filled with lack of capitalization, SMS text like 'Urself', lack of punctuation and so on; what I see is someone who just doesn't care to make even an eighth grade presentation of themselves. I also see that you feel we are not worth the effort. Posts that look like this show that you don't feel the person you are talking to is worth speaking to as an adult. If you show this level of contempt or apathy towards someone you are asking for help how can you expect to be taken seriously or expect to receive that expert's fullest attention and time to help you?
My standard beginner resources post - Updated JAN 2013
Plan your study route:
There are three routes people seem to take when learning programming.
- Just start trying to create programs
- Start taking apart other programs and try to figure out the language by reverse engineering
- Follow a guided learning course (school or self-teaching books)
For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.
- First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover.
- Do a dozen on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.
- Learn to plan before you type.
- THEN you start designing software with a purpose.
I don't learn from reading books: I learn by doing.
Spoiler
Total honesty here: That is either B.S., you haven't really tried, or this is the wrong career field for you so bail out now.
You can try to learn C# by dismantling snippets and googling terms - basically you can take a hit-n-miss, shotgun approach. But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language throughbanging on the keyboard experimentation - or you can learn by doing the tutorials and following a good "How to learn C#" book. There are so many great "How do I build my first application" tutorials on the web... There are dozens of "Learn C# in 21 days", "My first C# program" type books at your local book seller or even public library.
I'll tell you from experience that just fumbling around in the dark and trying to teach yourself with no guidance doesn't work. Its like stumbling across a Harrier Jump Jet and trying to teach yourself how to fly with no background in piloting: You simply lack any groundwork to start from. How can you lay out your own training course if you don't already know the material? Would you go to a university where the teacher says "I don't know any of this but we'll fumble through it together?"
Total honesty here: That is either B.S., you haven't really tried, or this is the wrong career field for you so bail out now.
You can try to learn C# by dismantling snippets and googling terms - basically you can take a hit-n-miss, shotgun approach. But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language through
I'll tell you from experience that just fumbling around in the dark and trying to teach yourself with no guidance doesn't work. Its like stumbling across a Harrier Jump Jet and trying to teach yourself how to fly with no background in piloting: You simply lack any groundwork to start from. How can you lay out your own training course if you don't already know the material? Would you go to a university where the teacher says "I don't know any of this but we'll fumble through it together?"
Newbie/Rookie said:
I have little/no programming experience but I need to write a program by Friday that does XYZ.
Spoiler
You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"
We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.
For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.
Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."
I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).
You need to start there. I can't say "I have little experience in speaking Russian, but I have been assigned to write a mystery novel in Russian. Can you help me?"
We can help you by saying "First learn basic programming and the language of C#. Then take on assignments." Could someone here write this program for you? Sure. Could someone here map out all the processes you need to follow and do the Software Design part of this in the slim hope you could code it from there? Sure. But we don't volunteer to do the job that you're either getting paid for, or getting a grade for. You may want to read this.
For now, just work on the lessons. Do a self-teaching book from cover to cover. Then consider writing a program.
Don't try to create a useful working program to fit a need of yours (or a for-pay contract) as your introduction to coding project. When you are learning to code you don't know enough to code a program, let alone know how to engineer the architecture of a program. It would be like saying "I don't know how to read sheet music, or play an instrument. I think I'll write a 3 act opera as my first learning experience."
I don't say this to be mean. We've seen lots of new coders take this approach and we know it doesn't work. Trying to design your own programs before you understand the basics of the code language you've chosen just leads to problems, frustrations, and 'swiss-cheese' education (lots of holes).
Resources, references and suggestions for new programmers.
Spoiler
Some of the tutorials below may not be in your chosen program language {C#, Java etc.} But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Free resources:
Articles that I constantly send people to - Good place to start.
Further debugging of your own code so you aren't asking others to do it for you:
The stages of asking for homework help on a forum
Thread with example WPF window using binding and a UserControl with properties
Beginner:
[font="Arial Black"]Martyr2's mega project ideas list is a great place to start on developmental projectst that you can learn from; rather than trying to make something complex like a game as a self-teaching tool {that never works for anyone}
I hate sending people to another site when we have such good tutorials here, but this series shouldn't be overlooked.
Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.
Intermediate:
Everyone:
Some of my common tips (some may apply more than others to your specific style):
Some of the tutorials below may not be in your chosen program language {C#, Java etc.} But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.
Free resources:
Spoiler
- We have a tutorials section and a Learning C# series of articles.
- MSDN Press - Free books
- There are numbers How-To videos on YouTube. Try this search: C# lesson 1
Articles that I constantly send people to - Good place to start.
- Learning C# series
- Understanding the common errors
- Bulding an application - Part 1
- Building an application - Part 2
- Quick and easy custom events
- Passing values between forms/classes ('How do I get Form1 to talk to Form1?')
- Separating data from GUI - PLUS - serializing the data to XML
Further debugging of your own code so you aren't asking others to do it for you:
Spoiler
Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on.
Writing a text file tutorial.
Reading a text file tutorial.
.Split()ing a string
Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on.
Writing a text file tutorial.
Reading a text file tutorial.
.Split()ing a string
The stages of asking for homework help on a forum
Thread with example WPF window using binding and a UserControl with properties
Beginner:
- C# learning series right here on Dream in code
- MSDN Framework Development Guide
- C# Reading list by Eric Lipert
- C# Fundamentals: Development for absolute beginners (video series)
- Build a Program Now! in Visual C# by Microsoft Press, ISBN 0-7356-2542-5 is a terrific book that has you build a Windows Forms application, a WPF app, a database application, your own web browser.
[font="Arial Black"]Martyr2's mega project ideas list is a great place to start on developmental projectst that you can learn from; rather than trying to make something complex like a game as a self-teaching tool {that never works for anyone}
- Visual Studio Keyboard Shortcuts
- D.I.C. C# Resource page Start here
- Intro to C# online tutorial then here...
- C# control structures then here.
- MSDN Beginner Developer video series
- MSDN video on OOP principals, making classes, constructors, accessors and method overloading
- MSDN Top guideline violations, know what to avoid before you do it.
- Design patterns as diagrams
I hate sending people to another site when we have such good tutorials here, but this series shouldn't be overlooked.
- Programming OOP in C# - Part 1
- Programming OOP in C# - Part 2
- Programming OOP in C# - Part 3
- Programming OOP in C# - Part 4
- Programming OOP in C# - Part 5
Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.
Intermediate:
- OOP design patterns
- Microsoft Events (webcasts and podcasts)
- WPF version (WPF-MVVM data binding)
- Decouple your multi-threaded work from the GUI so forms don't hang
- Working with environmental variables
- 'Why do we use delegates?' thread
- And everyone always wants to connect to a database, right out of the gate so Database tutorials right here on DIC
- C# Cookbooks
- Are a great place to get good code, broken down by need, written by coding professionals. You can use the code as-is, but take the time to actually study it. These professionals write in a certain style for a reason developed by years of experience and heartache.
Everyone:
- Microsoft Visual Studio Tips, 251 ways to improve your productivity, Microsoft press, ISBN 0-7356-2640-5 Has many, many great, real-world tips that I use all the time.
- MSDN C# Developers Center with tutorials
- Welcome to Visual Studio
- Free editions of Visual Studio 2010
- Student editions of Visual Studio
Some of my common tips (some may apply more than others to your specific style):
- Take the extra 3 seconds to rename your controls each time you drag them onto a form. The default names of button1, button2... button54 aren't very helpful. If you rename them right away to something like btnOk, btnCancel, btnSend etc. it helps tremendously when you make the methods for them because they are named after the button by the designer.btnSend_Click(object sender, eventargs e) is a lot easier to maintain than button1_click(object sender, eventargs e)
- You aren't paying for variable names by the byte. So instead of variables names of a, b, c go ahead and use meaningful names like [font="Courier New"]index, timeOut, row, column and so on. You should avoid 'T' for the timer. Amongst other things 'T' is commonly used throughout C# for Type and this will lead to problems. There are naming guidelines you should follow so your code confirms to industry standards. It makes life much easier on everyone around you, including those of us here to help. If you start using the standards from the beginning you don't have to retrain yourself later.
You might want to look at some of the naming guidelines. Its a lot easier to start with good habits than to break bad habits later and re-learn.
- Don't use your GUI objects as your variable. In other words don't keep referencing TextBox4.Text everyplace. TextBox4.Text is not a variable or property. The GUI is on its own thread so as soon as you start doing multi-threading you're screwed because your worker thread can't access the GUI elements. Use properties.
- Try to avoid having work actually take place in GUI control event handlers. It is better to have the GUI handler call other methods so those methods can be reused and make the code more readable. This is also how you can send parameters rather than use excessive global variables. Get in this habit even if you are using WinForms because WPF works a lot under the idea of "commands" and this will get you working towards that. Think of each gester, control click, menu option etc. as a command to do something such as a command to SAVE. It doesn't matter where the command comes from, all sources should point at the same target to do the actual saving.
Spoiler
// All of this different triggering mechinisms call the same single [il]SavePreferences()[/il] method btnSave(object sender, eventargs e) { SavePreferences(preferencesPath); } <KeyboardShortcut control+s bound to save> <Touchscreen guesture swiping from lowerleft to upperright bound to save> SaveMenuItem(object sender, eventargs e) { SavePreferences(@"C:\prefs\test.txt"); } SaveContextMenu(object sender, eventargs e) { SavePreferences();// No parameter method overload } FormMain_Closing(object sender, eventargs e) { if (IsDirty) SavePreferences(); }
- Don't replace lines of code that don't work. Instead comment them out and put your new attempts below that. This will keep you from re-trying the same ideas over and over. Also, when you come back to us saying "I've tried this 100 different ways and still can't get it", we can actually see what you tried. So often a failed attempt is very very close and just needs a little nudge in the right direction. So if we can say "See what you did in attempt 3... blah blah" it helps a lot
Spoiler// Try #1 - May 1, 0900hrs // code // code // code // Try #2 - May 2, 1700hrs Okay, plan B. What if I do it *this* way // code // code // code // Try #14 - May 3, 0500hrs after 5 cans of RedBull. Maybe I should get some sleep. I can't think of anything else but this last idea code code code
If you are using Visual Studio you can select a block of lines and hit control+k control+c (Kode Comment) to comment it out. control+k control+u (Kode Uncomment) to uncomment a selected block.
- You have to program as if everything breaks, nothing works, the cyberworld is not perfect, the attached hardware is flakey, the network is slow and unreliable, the harddrive is about to fail, every method will return an error and every user will do their best to break your software. Confirm everything. Range check every value. Make no assumptions or presumptions.
- I strongly suggest installing VMware or some other virtualization technology on your development PC so you can create a couple virtual computers for testing. This would allow you to debug and test inside: WinXP32, XP64, Vista, Win7x32, Win7x64... etc. without having to actually have 5 physical PC's. Visual Studio will let you send the debug directly into one of these virtual machines so you can watch it operate, check its variables, see the crashes and so on just as if it were debugging on your real machine.
- This can't be stressed enough in today's world of cell phone messaging:
Don't use txt/sms/leet/T9 speak like: dnt no wut i m do-n, coz, al gud, b4, ny1, sum1, u r, and so on like this guy. Its completely disrespectful to the senior coding professionals that volunteer here to mentor you.
Spoilerdis not b d'hood dawg... You are sitting at a real keyboard with a real monitor, not a cell phone. You are not here texting your high school posse to come to your kegger after their shift at Taco Bell. You are here asking for help from senior coding professionals who graciously donate their valuable time to helping the next generation of coders with their chosen craft. Please try to show them, yourself and the industry some respect by writing at least at an eighth grade level. (IE: English not ebonics or SMS, real words, punctuation and so on). If you can't take your own problem/question seriously enough to write like an adult, then why would you expect anyone else to take it seriously?
When you write a post you are presenting yourself. Your writing style is all you have to show others who you are and what you stand for. When I see posts filled with lack of capitalization, SMS text like 'Urself', lack of punctuation and so on; what I see is someone who just doesn't care to make even an eighth grade presentation of themselves. I also see that you feel we are not worth the effort. Posts that look like this show that you don't feel the person you are talking to is worth speaking to as an adult. If you show this level of contempt or apathy towards someone you are asking for help how can you expect to be taken seriously or expect to receive that expert's fullest attention and time to help you?
Page 1 of 1
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|

New Topic/Question
This topic is locked

MultiQuote





|