Beginner C# applications [closed] - c#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I just started learning C#, and I want to start making some small applications that are easy, but powerful.
Does anyone have any projects ideas? I'm interested to hear what you have in mind. Most of my experience is with HTML, CSS, JS, PHP.
Thanks

What do you like doing? I find games are always a cool place to start. If you like game-development you can do stuff like pong and pacman, but you can still have a lot of fun just making board and card games without much of the graphics complexity.
Here's some to get you started:
easier: tic-tac-toe, connect-4, go fish, black-jack, candyland, various solitaire games
medium: monopoly, poker, go, checkers, Yahtzee,
harder: scrabble, boggle, chess, Magic: The Gathering
here's different levels of difficulty:
design the logic. For example, make classes and methods to represent the board, properties, and the players in monopoly.
start making a gui. Make the game actually playable!
add AI and computer controlled players. Obviously AI is a huge subject, so there's many different ways you can go.
see here for a ton more projects on various topics

Since C# can be used in multiple types of applications, I'd try to do the same task in each. Perhaps a simple app that connects to a database and performs a lookup based on user input. Maybe connect to the "pubs" database that comes with the SQL Server samples.
You could do this as:
Winforms
ASP.NET WebForms
ASP.NET MVC
Dynamic Data
WPF
A Console app
using
Standard ADO.NET
LINQ
Entity Framework
You can even create a Windows Service that uses WCF, and a WinForms or ASP.NET front-end that consumes that service.
The idea is to get as many TYPES of apps under your belt as possible, so you can see how each is similar, and how each is the same. It will also help you get a better understanding of the "religious wars" over "which is best, Web Forms vs. MVC", etc. The ultimate answers to those "holy war" questions is invariably "what you're most comfortable with". There's nothing like having actual experience with the various options than to actually write something, so a nice, simple app in all of the available flavors would be a very good start.
And finally, since I listed so many things, here are some great starting points for everything I mentioned. There are videos, walk-throughs, etc to help you on your way.
http://www.asp.net/
http://windowsclient.net/default.aspx
http://msdn.microsoft.com/en-us/beginner/default.aspx

How about a scientific calculator? It'll give you basic experience with GUI building and event handling, it shouldn't be too hard to knock one up and most of your focus will be on the language rather than complicated algorithms (which is what you want when you're just starting to pick up a language.)

I've always heard that a simple game like checkers is good place to start. It lets you handle things like:
Separation of Model from UI (possibly
with a view model).
Skinning of controls or custom controls
and is easy to understand and test.

You can try to create something likes todo list. You can to provide a lot of custom feature for it (save/open data files, import to other formats, UI)

A good place to start is something like a calendar/todo application.
You won't beat all the great programs already out there that solve this problem, but you can start with a very simple but functional program, and add a feature a day for the rest of your life without running out of things you can do.
This gives a lot of opportunities for using different UI elements, doing some custom graphics rendering, serialisation/streams/io, database access, and even synchronising with web-based calendars, etc. i.e. It's easy to find a use for many different .net technologies within an application like this, but you don't need to use them: you can write a basic "useful" application in only a few minutes and keep adding to its facilities to learn new technologies.

Personally, something I'd like right now is a program that performs batch file management operations...
Sorting files into subfolders based on date or name patterns;
Renaming files based on user-defined patterns (e.g. add or remove a prefix from all filenames)
Renaming files based on metadata, if you can figure out how to read it (e.g. mp3 ID3 tags)
Then again, maybe this is too advanced. Or boring. I always find it fun to write a game that is a clone of an existing game, but add a twist. Like 3D tic-tac-toe... bad example maybe, but you get the idea.

Write a graphical dice roller simulator. It should be one window and when I press the "Roll Dice" button it simulates a roll of the dice, showing me an image of how my dice landed. And bonus points if it makes a nice dice roll sound. Extra bonus points if you let me choose how many dice to roll.
I expect to see this by tomorrow afternoon.
Good luck.

Maybe a little more advanced, but I enjoyed creating a little cheating program for playing the bejeweled blitz game. I followed Mike Vallotton's blog to get me started. it's here

Another good one would be to count the number of words in a text file.
Add a little more functionality to it by searching for keywords and returning how many of those were found in the text.

Start with writing a simple program using Form Application using a button and when clicked: Open a MessageBox saying Hello World. Then going over to new stuff like a webbrowser and then obtaining the source code from the site
3 basic steps in learning c# by webbrowser development:
1. create a basic browser that opens up a hardcoded site (site preprogrammed, not decided by user)
2. user controlled, textbox that the user can decide webpage with.
3.pulling out source code and changing every picture on a page for example. That will combine HTML and C# and since you have experience with HTML, changing the client side of the WebPage is good practice.
Good Luck :) Look up ThenewBoston on youtube, really great tutorials on C#

got a couple ideas:
you can make a pretty basic calculator [console application or windows form application]
you can make a dice (give random number between 1-6 or a random number between two numbers selected by the user.
a magic 8 ball, this uses the dice in the previous dot point, but instead uses the randomised integer and prints out the corresponding string.
you can make a planner application (an app that saves data such as todo list on a .txt file, etc).
you can also make a desktop assistant (i made one recently), that recognises voice and speaks to the user. It can also obey simple commands.
if you want to go deeper, you can try coding using C# to create unity games, i had some experience in this, it is very easy (got pretty good at it after reading some documentation and watching some tutorials).
but if you are just starting out, then i recommend you to work your way upwards and start off with making something simple.

Related

A route from vector drawing -> c# windows application

I have a requirement to present in my c# windows application a "map" of a building, with different rooms coloured in various ways to indicate various things. This needs to be renderable at different sizes and from different perspectives, and needs not to be a one off exercise, but a repeatable process for different establishments.
I am thinking of it in terms of an old school level editor (think old ID stuff), the product of which can be rendered top down; it sounds like an awful lot of work to get into designing my own editing tool, so am looking for a way to hook an existing tool into c#.
I have got the .NET drawing code down (if need be), and I have got the Adobe Illustrator design down (again, if need be) - what I am looking for is a way to link the two, or (if appropriate) a suggestion to use something different in those two roles entirely. Any and all suggestions very gratefully received, thank you!
I'd look at Microsoft Visio - it seems more appropriate for architectural/schematic diagrams than Illustrator and there should be already .NET libraries to use Visio-generated drawings.

Comprehensive tutorial for beginners on how to write Windows GUI programs

I'm trying to learn how to write Windows GUI* programs in C++, using Visual Studio 2008, but I haven't found any more comprehensive tutorial for beginners.
The more comprehensive tutorials I have found are either only about how to make buttons, menus, etc. OR only about how to write basic C++ console programs.
What I haven't found is a more comprehensive tutorial for beginners on how to combine buttons, menus, etc. with C++ code.
In other words, I'm looking for answers to the question: How do I link menus, buttons etc. to C++ code?
If you know where I can find answers to that question, post them here, please!
Note: "Graphical User Interface (GUI): Includes such things as icons, panels, and interactive windows, to enable users to perform such actions as opening files and creating applications with the click of the mouse" (intoweb.co.za/et-linux-tips.html).
I'm currently reading a C# tutorial at techotopia.com, that seems to include not only C# basics but also useful information on how to use C# to get buttons, menus. etc. to actually do something. I only started reading the tutorial, though, so how useful it actually is I don't know yet.
I've now finished reading the C# tutorial at techotopia.com and learned some basic facts about how to actually make controls on a windows form do something. Had I known what I now know about C# earlier, I most likely would have chosen to learn that language before I started learning C++.
It's beyond me why each and every C++ GUI programs tutorial for beginners aren't written in the same style as the tutorials at techotopia.com. I see no reason why C++ GUI programs tutorials for beginners can't be both crammed with basic facts AND explain even the simplest things to people like me, that need such explanations to understand a new subject. Well, there probably are such tuturials, only I haven't found them.
Now is the time, I think, to make a short list of what steps I have taken to get where I am today when it comes to computer skills in general and ability to write computer programs in particular. I'm posting the list here for the benefit of people who wants to become good at writing computer programs but don't know how to reach that goal or have mislead themselves, as I have time and time again. It's not a final list in any way. It's just a short account of what have worked for me.
Step 1. Use lots of computer programs (word processors, image editors and what else you're interested in) to see what can be done with a computer.
Step 2. Write web pages with HTML and CSS. HTML, Hypertext Markupup Language, are used to tell browsers things like the beginning and end of paragraphs, the structure of tables and where to include images. CSS, Cascading Style Sheets, are used to add things like text-size and background-color to web pages.
Step 3. Improve your web pages with PHP. PHP, Hypertext Preprocessor, reminds of C# and C++ and is a server-side scripting language. Server-side means that something is done to a web page before it is sent to a visitor's browser, like adding code that makes it possible to send a message. PHP is easier for a beginner than C# and C++. Also, if you have written some HTML pages, you can gradually add PHP to these pages. In other words, you can learn how to use PHP in a familiar context.
Step 4. Learn C#. Reminds of PHP and C++. More difficult for a beginner than PHP but easier than C++. This is where I am right now. These links may be of at least some use:
Quick And Dirty Guide To Migrating PHP Code To C#
C# Station C# Tutorial on how to write console programs
dotnetperls.com
George Shepherd's Windows Forms FAQ
C# Corner
csharp-examples.net/examples (very short code snippets)
Visual C# at msdn.microsoft.com (probably more useful when you're no longer an absolute beginner; at least I think so)
Some basic C# tutorials (written by me and not amongst the best tutorials you can find; however, I would have found a page similar to this one useful when I first started learning C#)
Step 5. Learn C++. Reminds of PHP and C#. More difficult for a beginner than PHP and C#. Allows the programmer to control more than C#. Some people say it's faster than C#, while other people don't. This is where I hopefully will be within a year or so.
Since there are as many roads as there are budding programmers, these steps may not be right for you. Hopefully, though, the list above is of at least some assistence to you when you decide what steps to take to reach your goal.
If you know more about programming than I do and disagree with the list above, feel free to provide your own list. If you do, I think you should also explain why you think your list is better.
Charles Petzold wrote a book on that.
I haven't read it, but his Win32 UI book is widely known as hilarious, so it is expected to be good for beginners.
As you can probably already tell from other answers and comments, the term "Windows Forms" is the name for a specific .NET technology.
You seem to want to ask a question more along line of how to learn to write Windows programs that have a GUI (menus, buttons, windows, etc).
There is no single way to write a Windows program. C++ itself doesn't know anything about Windows. Instead you will end up using some API or framework. So what you need to do is choose which particular one you want to use and then learn that.
At the lowest level there is the raw
Windows API. However it is a very
C-like interface and few people would
recommend starting there.
Microsoft's C++ based framework for building Windows programs is MFC (Microsoft Foundation Classes). It was created long before .NET and C++/CLI and such. Being so old, there are aspects of it that haven't been able to change to keep with the times and so some people don't like it. But it's still supported and used. In fact, if you have a full version (not an express version) of Visual Studio then you already have MFC available.
There are various other C++ frameworks that have come along more recently. Qt and WxWidgets are a couple of the bigger names. Many of these not only give you a way to create Windows programs, but also try to abstract away all the OS-specific details so that your code can be compiled to work on other OS's (like Linux or Mac) too. In my opinion, these are often more pleasant to work with than MFC once you learn how.
Even though its not what you're asking for, many people would actually recommend using C# and .NET for making GUI programs in Windows. There are some nice aspects of that language and framework that make GUI programming easier.
So you probably need to do a little investigation to determine what technology you actually want to learn and use. Then you can go searching for appropriate tutorials.
A somewhat old thread but here's what could arguably be the updated Petzold replacement:
"Windows System Programming (4th Edition) (Addison-Wesley Microsoft Technology Series)"

Good little project to do when learning C# WPF

I want to write a little application for myself to learn C# and WPF.
The typical hello world in 2009 (twitter client) seems boring. I would like to hear your stands should I do a twitter client? Any other starters I could play around with and get used to c#? (I'm a longtime PHP programmer)
A Twitter client ends up being a good way to get started with WPF, for a few reasons:
It's got lists of data with images, which gives you practice with formatting and styling lists
There are a lot of options for styling what you're working on - partly due to the avatars, limited text blocks, etc.
A Twitter app is the kind of application where you expect to see good UI
There are some good libraries availble (I highly reccommed tweet#) so you don't need to bother with any of the plumbing
It's something you can show off and be proud of - people will understand what it does
There are plenty of complex things you can add on later if you want - skinning, drag and drop, autocomplete, spell checking, etc.
There are some open source WPF clients out there, so you can find some sample code if you get stuck
And the number 1 reason why it's good idea... you can start contributing your code to the Witty project. We'd love more help!
I recommend to write a native GUI (WPF) client for your most recent PHP project.
You can try writing a modelling tool (business processes flow/UML (classes)/execution flow i.e. scripts execution flow/etc...).
WPF Virtual Labs are a good place to start.
Only do a twitter client if that's what you're interested in. I don't see why twitter should be the new "hello world.", except maybe for making such a thing, like a twitter or facebook bot.
If you want to focus on C# and OOP, try something with many objects interacting, like a simple fighting game, poker, black-jack, etc.
If you want to learn wpf, try some fancy interface stuff, like a calculator, a video player, a photo gallery.
You're only limited to your imagination. Try to pick something fun, or something you'd like your computer to do, and code away. :D

What is a good project to learn Windows Forms programming in C#?

I want to learn c# so I can do some desktop developing. I've developed command-line C# applications and wanted to expand to Desktop applications.
I was thinking of create a screenshot tool like Jing or maybe a plugin for outlook to sync contact information with a service like Google.
What are your thoughts? My past experience is with web applications built in PHP.
I would try to start with something fairly contained, which only touched a few new technologies. For instance, if you want to learn Windows Forms, write something which uses that but doesn't need to talk to Outlook, Google, or the Win32 API. Once you've got the hang of Windows Forms, try one extra technology - try displaying your Google Contacts and do offline editing, for example. Then add another technology... etc.
In my experience it's hard enough to learn one new technology at a time - but that's far quicker than trying to learn two or more in one go. You inevitably get to the stage where you don't know where the problems are, and you have no confidence in any of your code because it's all new. This is particularly important if you're still fairly new to the language as well - although I'm glad to hear you started with some console apps :)
Sorry if that sounds like I'm being a wet blanket, and I realise it sounds like you'll take far longer to get to something useful that way, but I think you're more likely to be successful in the long run.
Find something that most importantly interests and excites you. If you pick something too boring that you don't care about you'll only give up before you get anywhere, and won't benefit at all. Don't do a rubbish project for the sake of learning a language. Do a good project, and do it in a new language as a side effect.
Make a notepad clone. While being fairly simple it will give you a primer in some basic Windows Forms mechanisms such as using menus and reacting on their events, getting input from controls for storage on disk, reading from disk and updating controls, using Docking and Anchoring and so on.
Twitter clients are the new hello world.
I read that somewhere the other day. I can't personally comment on its fitness for your goal.
Do something that you did before, but in another language. Then you won't have to think about most of the architecture of the particular task again, but you'll be able to compare the languages, the frameworks and their approaches.
I bet you'll learn a lot about your previous language as well doing this excercise.
A good project would be a simple windows form. You simply have a chance to put everything together. Or at least see a bigger picture.
You can make it as complicated as you want, without sticking to one area.
Suggesting a specific project is pointless. Think of something that interests you, or an application you want/need, then start making it - searching Stackoverflow/Google/MSDN/etc whenever you can't guess how to do a specific task.
For example, I had to make kiosk application that allowed customers to signup to a companies mailing-list. I tried using the Ruby framework Shoes, but it didn't work correctly on the laptop the application was to run on. Visual C# seemed like a better fit, and would almost certainly run correctly..
So I installed Visual C# Express, added a few labels and a button. I double clicked the button, and realised I didn't know the code to create a new WinForm window.. So I searched Google for "visual C# open new dialogue" or something, and I found out I had to add a new form, then call NewForm newwindow = new NewForm(); newwindow.show(); or similar.
Then, I added the username/email fields, then searched for "how to display an alert box" and checked I could display the form values.
That all worked, so now I had to decide how to store the emails. I had heard good things about LINQ to SQL, so looked into that, decided I wanted to use SQL Server CE (so I didn't have to install/run SQL Server on the laptop). That resulted in more searching around for how to make LINQ to SQL work with SQL Server CE..
Finally, I wanted to have a configuration panel to change the title/button strings etc (accessible via a certain keyboard shortcut).. A Google search revealed how to catch keystrokes, and I asked a Stackoverflow question about representing the settings (using a PanelView or something)
..anyway, the point of that slightly long, rambling and not terribly interesting story is.. You can learn many new technologies at once, as long as you have a specific application in mind (and you're determined to finish it!)
I learned C#, WinForms, SQL Server CE, LINQ to SQL, and simple application publishing stuff in a day - creating a functioning, useful application in the process - simply with a combination of prodding around, Google searches and Stackoverflow..

Data visualization in desktop applications

I would like to create data visualizations in desktop apps, using frameworks, languages and libraries that help with this kind of task. Visualizations should be interactive: clickable, draggable, customizable, animated...
What I would like to create is something similar to the examples seen here: http://www.visualcomplexity.com/vc/
These are the links I already know: http://delicious.com/laura_laura/visualization?setcount=100
The preferred language is C++/Visual C++ (MFC) because I'm familiar with it, but any other technology is welcome, I would like to make a list from "as similar as possible" to Visual C++ to "very different" from Visual C++.
WPF, flex, Adobe Air, flare, JavaScript (running in a browser as client-side apps with access to local files or as desktop apps) are possibilities, post any good links to examples, tutorials, how-tos, etc. that you know of.
What are the learning curves and complexity for the different options? Which one would you choose and why? Which one have you already worked with and how was your experience? How would you start with a project of this characteristics?
Your post has far too many questions in it to be answered easily in one response, so you might try re-posting with specific questions. Data visualization is a HUGE area of study and it's not significantly different for web applications versus desktop applications.
Put simply, it's the display of data in a way that visually tells the story of the data. It's most useful in cases where the volume of data is such that tabular display isn't effective. Trends, outliers, and abnormal occurrences can sometimes only be seen when data is represented visually. Visually can be a simple chart, or it can be more advanced visualizations such as treemaps or thematic mapping/GIS presentations.
If it's an area you're interested in studying, look into:
Edward Tufte - Author, professor, and all-around guru for the display of information
Many Eyes - from IBM AlphaWorks
Processing - A visual "sketching" language based on Java
Visualizing Data - An O'Reilly book by Ben Fry, one of the co-creators of Processing
Beyond that, I think specifics would depend on what you want to accomplish -- what data is being analyzed, who the audience is, and what the desired "message" is.
If you're willing to use the Flash/Flex/ActionScript/AIR development platform, then take a look at the "flare" library, from the prefuse project:
http://flare.prefuse.org/
I've only gotten my feet wet with it at this point, but so far I like what I see.

Categories