Yeah.. totally agree with QuackWare, the best thing to do is to come up with a small project and just go from there. Something that you like, web page, application etc.. personally if you come up with a idea of what you want to code (do not worry about the coding etc, if you have to re-write 1,2,3,4 times so what you are learning) text pad is the classics, or a clock.
CodingfriendsCode:int coffeePerDay = 10; // need to cut down!!!
I was having a similar problem. i decided to stick with C# because it seems to have a good balance of simplicity and functionality. one thing im doing right is making a notepad application with the features you might find the real notepad. the fun part is you can keep building and adding more features as you learn more. i dont really know how to use alot in C# yet but i have been asking on the forums whenever i am stuck and have received good help quickly.
Try making your own notepad! the first thing you should do once you have your gui layed out is make a second form and have it open up with your name and why your creating the program upon a click on your toolstripmenu . thats where i started and im really having fun today!
Psynic, yeah. .c# is a good language to start with, you get to learn the basics about different ideas of programming, e.g. variable types/ classes..
Does you notepad program have features like on-the-fly loading of plugins for different syntax highlighting ? or are you going to implement that ?
CodingfriendsCode:int coffeePerDay = 10; // need to cut down!!!
Yeah don't give up I forgot the basics of C++ and am relearning from scratch like a week ago...and this time I keep notes and stuff and am on this forum see?
hah genux im still building on my notepad. i eventually want to implement those things as i get more advanced. right now im stuck on the print feature : ( however open save and font features are working along with copy, cut, paste, select all and an about feature that opens a second window with some information on the program. you dont happen to know how i can properly use the printpreviewdialog code do you genux?
Hi Psynic, I have not used the prjntpreview before in c# but could look into it for you ? And give some code example in how to use it ?
CodingfriendsCode:int coffeePerDay = 10; // need to cut down!!!
hey genux. ok if you could shed any light on that i would be soo grateful i still cant get it. i have like half of the code working if you want to see what i have so far for the code you can find it in my blog here. http://forum.codecall.net/blogs/psyn...d-project.html
its in one of my comments on the blog.
I had the same problem as you actually. I never could get into programming because all I saw was a wall of history text.
I found a tutorial for C# that explained things from a video game/Windows basics perspective (i.e Namespace is a folder, etc).
Since I was a gamer, it worked well for me because it merged my interests.
The point is:
Perhaps you're tackling learning in the wrong way. Instead of trying to learn conventionally, try learning from a different perspective (in my case, it was the gamer perspective). It really helps.
Not sure if this helps, but from this page,
How to: Print in Windows Forms Using Print Preview
You can create a printpreviewdialog. How it works is that you need to have a print document that is filled in with the details that you want to display on the print preview, this is created with a call via a event handler call PrintPage (when you request a print preview this will be called basically), and then fill in the printDocument with the details that you want to print, here is some code
where the editorText is the multi line textbox.
very basic code and also mainly taken from that previous URL from MS. Not sure if it helps ?Code:private void button1_Click(object sender, EventArgs e) { PrintPreviewDialog printDialog = new PrintPreviewDialog(); PrintDocument printDoc = new PrintDocument(); // add in a new event handler so that when a printpage is requested to call this function. printDoc.PrintPage += new PrintPageEventHandler(fillInThePrintDoc); // set the print dialog document (the bit that you view) to the printDoc (the print out document) printDialog.Document = printDoc; // show the print dialog printDialog.Show(); } void fillInThePrintDoc(object sender, PrintPageEventArgs e) { int charactersOnPage = 0; int linesPerPage = 0; // Sets the value of charactersOnPage to the number of characters // of stringToPrint that will fit within the bounds of the page. e.Graphics.MeasureString(editorText.Text, this.Font, e.MarginBounds.Size, StringFormat.GenericTypographic, out charactersOnPage, out linesPerPage); // Draws the string within the bounds of the page. e.Graphics.DrawString(editorText.Text, this.Font, Brushes.Black, e.MarginBounds, StringFormat.GenericTypographic); }
CodingfriendsCode:int coffeePerDay = 10; // need to cut down!!!
OMG Genux <3 thank you so much. i was actually looking at the code from the tutorial on here and wondering why printDoc.PrintPage += new PrintPageEventHandler(fillInThePrintDoc); was giving me and error at (fillintheprintdoc) and i was thinking maybe there is a call he is doing but im not seeing the code? that's clearly what it was now that i see it. seriously thank you a ton for checkin that out. i know its a simple thing but it was driving me crazy.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks