Hack Forums
[Delphi] [Delphi] How to make a simple notepad [Tutorial] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Delphi] [Delphi] How to make a simple notepad [Tutorial] (/showthread.php?tid=363491)

Pages: Pages 1 2


[Delphi] How to make a simple notepad [Tutorial] - djfshady - Apr 12, 2010

If you post this on another forum remember to give credits.

Hello there today ill show you how to make a simple notepad in delphi.

what you will need:

1 memo
1 mainmenu
1 save dialog
1 open dialog


ok let's begin, first off place a memo which is found here:
[IMG]http://i41.[censored].com/w8m3yh.jpg[/IMG]

now to delete memo1 text inside the box click memo1 and now click list then remove the text/add some text then click ok:
[IMG]http://i42.[censored].com/10sc51k.jpg[/IMG]

on your form, after that go add in a mainmenu which will be found here:
[IMG]http://i40.[censored].com/erylus.jpg[/IMG]
after that double click the mainmenu.

Type in 'File' here:
[IMG]http://i39.[censored].com/htzi47.jpg[/IMG]

Next click the little box that pop's up under 'File' and type in this, 'New'
now type in this under 'New' , 'Open' then finally under 'Open'
type in 'Save' all without the '

now it should look like this:
[IMG]http://i40.[censored].com/34z14zo.jpg[/IMG]

ok now add in a savedialog and opendialog which can be found here:
[IMG]http://i40.[censored].com/e5hfzo.jpg[/IMG]
ok now for the Coding:

double click 'New' and type in this
Code
memo1.clear;

Now click 'Open' and type in this:
Code
OpenDialog1.Execute;
memo1.Lines.LoadFromFile(OpenDialog1.Filename);

Ok now in 'Save' type in this:
Code
SaveDialog1.Execute;
memo1.Lines.SaveToFile(SaveDialog1.Filename);

Your application should look like/similar to this:
[IMG]http://i42.[censored].com/nly628.jpg[/IMG]
There you have it :) a simple notepad now press this to test your application:
[IMG]http://i39.[censored].com/29pyvqo.jpg[/IMG]

Or you can go here:
[IMG]http://i40.[censored].com/531rnl.jpg[/IMG]

Or you can simply just press F9

The result Of the program will be similar to this:
[IMG]http://i43.[censored].com/19tfm9.jpg[/IMG]
Credits:
djfshady - me

Hope you liked my tutorial :)



* - DeltaNox - Apr 12, 2010

Nice, very useful for beginners.


* - WarlockSyno - Apr 12, 2010

Very nice. Simple and straight to the point. Thanks.


* - djfshady - Apr 13, 2010

your welcome guy's , im going to be making more delphi tutorials for beginner's :) , then i might go onto things like binder's,crypters ect


* - maype - Apr 25, 2010

Thanks Im Beginning Delphi and Its Usefull haha :p ;)


* - djfshady - Apr 25, 2010

im happy to know your starting delphi , you wotn regret it :) , checkout the other tutorials i have , im going to be making a massive series of youtube tutorials on delphi , they will be posted on my site first then ill add them onto hackforums.


* - Tobie Montana - Jun 22, 2010

How do i make it save in .txt and open in .txt automaticlly? and why do i get bug when i press open and dont select anything, the bugg comes when i close it without selecting anything.


* - djfshady - Jun 22, 2010

you may have typed something wrong , mabye copy and paste what my code and see if it works then.


* - pushl %ebp - Jun 22, 2010

Haha, that looks really cool.
I don't really like delphi though. :s


* - djfshady - Jun 22, 2010

thanks :) im going to be making some more tutorials today post them up later today :D


* - DrSponge - Jun 22, 2010

Good tutorial i rember making a simple notepad in delphi :D
Great tutorial again for beginners :)


* - Tobie Montana - Jun 23, 2010

Ya, its exactlly the same but i dont have the same names on my dialogs and memo thats the only thing that is different :S Im gonna look at some more tutorials on notepads so i find the problem :P I just started with delphi and its kinda fun but so freakin hard... U got any tips on tutorials? with is the best ones?


* - djfshady - Jun 23, 2010

i have a tip, dont buy ebooks about it , its best to get someone to help you over teamviewer or somthing or read tutorials like mine , stuff like that but an ebook for beginners may be a little confusing for you. but once your more advanced in dephi then you could consider buying an ebook.


* - jsbrohi - Jul 12, 2010

new on Delphi Need Help! Please Help!


* - Fallenbot - Jul 12, 2010

This is a GREAT Guide For BEGGINERS.

Excellent work.
Very detailed.