Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 23:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Tutorial]Creating a notepad app[Lot of Text]

Discussion on [Tutorial]Creating a notepad app[Lot of Text] within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
plasma-hand's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 442
Received Thanks: 105
[Tutorial]Creating a notepad app[Lot of Text]

Create a Notepad App
In this tutorial I will show you how you can create your own Notepad like Application.

Start by creating a new Windows Forms Application.

Now we can add some controls. The first control will be a MenuStrip.

After that right click on the newly created menustrip, Select Insert Standard Items. Delete the Tools menu and the Help menu. Delete the Redo menu item from the Edit menu.

Now drag and drop a TextBox onto the form.

Make sure that the textbox can have more than one line, by selecting the multiline checkbox.

Type in txtBox for the name of our newly created textbox. Set the Dock to Fill

Now we will do some coding.

For the New menu item's Click() event type in
Code:
txtBox.Clear();
For the Open menu item's Click() event type in
Code:
 //Declare open as a new OpenFileDailog
            OpenFileDialog open = new OpenFileDialog();
            //Set the Filename of the OpenFileDailog to nothing
            open.FileName = "";
            //Declare filename as a String equal to the OpenFileDialog's FileName
            String filename = open.FileName;
            //Declare filter as a String equal to our wanted OpenFileDialog Filter
            String filter = "Text Files|*.txt|All Files|*.*";
            //Set the OpenFileDialog's Filter to filter
            open.Filter = filter;
            //Set the title of the OpenFileDialog to Open
            open.Title = "Open";
            //Show the OpenFileDialog
            if (open.ShowDialog(this) == DialogResult.OK)
            {
                //Make the txtBox's Text equal to all of the text in the OpenFileDialog's FileName(filename)
                txtBox.Text = System.IO.File.ReadAllText(filename);
            }
            else
            {
                //Return
                return;
            }
For the Save and Save As menu items' Click() event type in

Code:
//Declare save as a new SaveFileDailog
            SaveFileDialog save = new SaveFileDialog();
            //Declare filename as a String equal to the SaveFileDialog's FileName
            String filename = save.FileName;
            //Declare filter as a String equal to our wanted SaveFileDialog Filter
            String filter = "Text Files|*.txt|All Files|*.*";
            //Set the SaveFileDialog's Filter to filter
            save.Filter = filter;
            //Set the title of the SaveFileDialog to Save
            save.Title = "Save";
            //Show the SaveFileDialog
            if (save.ShowDialog(this) == DialogResult.OK)
            {
                //Write all of the text in txtBox to the specified file
                System.IO.File.WriteAllText(filename, txtBox.Text);
            }
            else
            {
                //Return
                return;
            }
After enter this code
Code:
//Declare prntDoc as a new PrintDocument
            System.Drawing.Printing.PrintDocument prntDoc = new System.Drawing.Printing.PrintDocument();
For the Print menu items' Click() event type in
Code:
//Declare print as a new PrintDialog
            PrintDialog print = new PrintDialog();
            //Declare prntDoc_PrintPage as a new EventHandler for prntDoc's Print Page
            prntDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(prntDoc_PrintPage);
            //Set prntDoc to the PrintDialog's Document
            print.Document = prntDoc;
            //Show the PrintDialog
            if (print.ShowDialog(this) == DialogResult.OK)
            {
                //Print the Page
                prntDoc.Print();
            }
Now enter this code right after the print item's Click() event
Code:
private void prntDoc_PrintPage(Object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            //Declare g as Graphics equal to the PrintPageEventArgs Graphics
            Graphics g = e.Graphics;
            //Draw the Text in txtBox to the Document
            g.DrawString(txtBox.Text, txtBox.Font, Brushes.Black, 0, 0);
        }
Now enter this code for the Print Preview menu item's Click() event
Code:
//Declare preview as a new PrintPreviewDialog
            PrintPreviewDialog preview = new PrintPreviewDialog();
            //Declare prntDoc_PrintPage as a new EventHandler for prntDoc's Print Page
            prntDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(prntDoc_PrintPage);
            //Set the PrintPreview's Document equal to prntDoc
            preview.Document = prntDoc;
            //Show the PrintPreview Dialog
            if (preview.ShowDialog(this) == DialogResult.OK)
            {
                //Generate the PrintPreview
                prntDoc.Print();
            }

Almost Done!!
Now go to the Exit menu item's Click() event and type
Code:
Close;
Now go to the Undo menu item's Click() event and type
Code:
txtBox.Undo();
Now go to the Cut menu item's Click() event and type
Code:
txtBox.Cut();
Now go to the Copy menu item's Click() event and type
Code:
txtBox.Copy();
Now go to the Paste menu item's Click() event and type
Code:
txtBox.Paste();
Now go to the Select All menu item's Click() event and type
Code:
 txtBox.SelectAll();
As for the leechers who want to impress their friends and say they made it.I uploaded source files
Attached Files
File Type: zip Notes.zip (63.6 KB, 20 views)
plasma-hand is offline  
Thanks
3 Users
Old 11/14/2008, 07:50   #2
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 81
Nobody cares. If we wanted a notepad application im sure we would have used the one that came with the OS, if we wanted to learn how to make one we would have gone to a general programming forum or searched google, not a Conquer online programming forum.
ChingChong23 is offline  
Thanks
1 User
Old 11/14/2008, 13:15   #3
 
MushyPeas's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 800
Received Thanks: 89
download done
MushyPeas is offline  
Old 11/14/2008, 14:08   #4
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Thanks for releasing this... even if no one needs it, it will still teach someone out there how to do something.
taguro is offline  
Thanks
3 Users
Old 11/14/2008, 15:52   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 490
Received Thanks: 595
Quote:
Originally Posted by taguro View Post
Thanks for releasing this... even if no one needs it, it will still teach someone out there how to do something.
That might be so, cant disagree on that but i dont know dont see how it is related to "CO2 Programming" but thats my opinion
_fobos_ is offline  
Old 11/14/2008, 16:32   #6
 
plasma-hand's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 442
Received Thanks: 105
Quote:
You can post here your request and questions/help for general programming
read before saying this is stupid maybe some people wanna learn dumbass
plasma-hand is offline  
Thanks
1 User
Old 11/14/2008, 17:30   #7
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by plasma-hand View Post
read before saying this is stupid maybe some people wanna learn dumbass
Agreed, afterall this site should be about learning, period. Besides alot of the methods invoked here can be used in programming a server.
taguro is offline  
Thanks
1 User
Old 11/14/2008, 21:50   #8
 
plasma-hand's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 442
Received Thanks: 105
thank you and after all it doesnt say co2 programming only it says related to general programming.it also should be about learning people that "know everything" or so they claim had to start somewhere.....everyone went through learning it
plasma-hand is offline  
Old 11/14/2008, 22:51   #9
 
elite*gold: 0
Join Date: Mar 2006
Posts: 583
Received Thanks: 182

^ that's for tuts on things that don't fit in other categories


^that's for things related to CO2



^that's very similar
UPSman2 is offline  
Old 11/15/2008, 00:10   #10
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by UPSman2 View Post

^that's very similar
More like copy/paste.
nTL3fTy is offline  
Old 11/15/2008, 02:53   #11
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
He could have written that guide x.x
Didn't say he did :X
tao4229 is offline  
Old 11/15/2008, 11:50   #12
 
MushyPeas's Avatar
 
elite*gold: 0
Join Date: Oct 2006
Posts: 800
Received Thanks: 89
Quote:
Originally Posted by taguro View Post
Besides alot of the methods invoked here can be used in programming a server.
Maybe his next extension to this notepad prog will be a co server then
MushyPeas is offline  
Old 11/15/2008, 12:27   #13
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by tao4229 View Post
He could have written that guide x.x
Didn't say he did :X
If he did, why didn't he include the pictures that were from the other website?

He's got the second half of the tutorial up already - misspelled word in the title and no pictures either:
nTL3fTy is offline  
Old 11/16/2008, 05:16   #14
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Quote:
Originally Posted by nTL3fTy View Post
If he did, why didn't he include the pictures that were from the other website?

He's got the second half of the tutorial up already - misspelled word in the title and no pictures either:
Dunno... Just pointing out a thought
Why can't pings fly either? :< That'd be freaking pr0.
[/spam]


Anyways, it's an okay tutorial i guess..
tao4229 is offline  
Old 11/22/2008, 05:37   #15
 
Shinobi-Of-The-Mist's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 43
Received Thanks: 2
You didn't even say what language it's in, so how would some noob that cant even make a program that just saves text files be able to figure the language out. Anyways, okay tutorial, kind of pointless though.
Shinobi-Of-The-Mist is offline  
Reply


Similar Threads Similar Threads
[TUTORIAL] Creating a simple DLL Cheat/Hack
07/12/2021 - Kal Hacks, Bots, Cheats & Exploits - 162 Replies
HOW TO CREATE YOUR OWN DLL HACK Hello guys, In recent days, I recieved many questions about how to use the pointers posted in one specific thread. So here is guide for creating the basic Proxy-DLL skeleton + hack. I will try to explain it to details. Requirements 1] Some C++ and UCE (memory and such stuff) knowladge 2] Some Time
[Tutorial] 3D-Text
03/20/2011 - Artist Tutorials - 7 Replies
Hey, wollte euch mal zeigen wie man einen schönen 3D-Text hinbekommt. Ist mein erstes Tutorial, also seit nicht so streng ;) Ergebnisse: http://img413.imageshack.us/img413/5566/tasubeatz schrift.png http://img15.imageshack.us/img15/458/chasehawk.pn g http://img101.imageshack.us/img101/2447/idul.png
Pls somebody a complete tutorial for Creating Pserver from start to end.
04/19/2009 - Dekaron Private Server - 19 Replies
Every time I start to make a Pserver I've some errors. Sometimes at SQL server install, sometimes at Apache... Someone pls write a complete tutorial: How can someone make a working Pserver with SQL install, database backup, querys, IP settings, server rate settings, account creation in SQL, account creation with php (inc. apache install, settings) and starting the server (dbmon, cast... and client edit in winhex). Thx, sry 4 my poor eng.
[Tutorial]Making my notepad app beter
11/14/2008 - CO2 Programming - 0 Replies
In this tutorial I will show you how to extend your notepad app we created in my tutorial We will add some Menu items to the MenuStrip. The first Item will we a new Menu Drop Down called Format. In the format Drop Down Menu add a menu item called Word Wrap. Set the Checked Property to true, set the CheckOnClick Property to true. Now select the TextBox(txtBox) and set the WordWrap property to true. Now go back to the Format menu and add one more menu item call it Font. Drag a FontDialog...



All times are GMT +1. The time now is 23:42.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.