Added: 3 years ago
From: killdude69
Views: 21,916
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (142)

Sign In or Sign Up now to post a comment!
  • i got 6 errors:

    name: "document" is not declared

    name:"document" is not declared

    name:"document" is not declared

    name:"document" is not declared

    name:"document" is not declared

    name:"document" is not declared

  • big problem with the save code, it adds it on, so if i had a text document and the text inside said "hello world" and i think i forgot the ! so i use this text editor code, the text then becomes

    "hello world

    hello world!"

    because it adds on and dosnt save properly

  • thanks for the help

  • @killdude the following isnt correct for vb 2010 quote:

    "Dim FontDlg As New FontDialog

    FontDlg.Show()

    Try RichTextBox1.Font = FontDlg.Font

    Catch ex As Exception ' Do nothing, either and error occured or the user canceled

    End Try"

    but change the fontdlg.show() to fonddlg.showdialog() will work

  • thanks for the codes... :)

  • I've got a better copy code that only copies selected text:

    If document.SelectedText = "" Then

    Else

    My.Computer.Clipboard.SetText(­document.SelectedText)

    End If

    sorry for the other post

  • I've got a better copy code that only copies selected text:  If document.SelectedText = "" Then Else My.Computer.Clipboard.SetText(­document.SelectedText) End If

  • For Cut, Copy and Paste, why not simply using Ctrl+X,C and V!?

  • I made Open and Save to global variables (I just put them after Public Class Form1 :D:D:D:D:D)

  • Thanks man great vid, learned a ton. the coding needed a tiny tweak but great thanks a ton

  • listen this is good but you need to explain us how did you get the code that's important

  • man good work.if ever know how many people you helped you be amazed

    thank one more time

  • how do you do the quick save that doesnt use the dialog box

  • very good

  • Good work man thanks!

  • Very good tutorial, slow but beginner will not miss anything from your video, i like it ^^

    Can i know how to create a HTML editor too? ^^

  • @wee3200 I will have a link for a HTML Editor as soon as I have made a tutorial

  • Nice video but u didnt put any code for the exit button

  • is it possible to make a button and if you click on it you go to the next line of the textBox?

  • that richtextbox1 that i have is called  gamertag and windowsliveID: can you tell me where to put those?

  • it says for me that the document doesnt exists

  • @AZBA11in replace "document" with "RichTextBox1" or "TextBox1" or whatever you name your Text Box that your using the command("document.copy()) for. hope that helped.

  • This is Font, worked for me

    Dim TF As New FontDialog TF.ShowDialog()  Try document.Font = TF.Font Catch ex As Exception ' The dialog failed or the user cancelled End Try

  • make a Sekect All in Edit

    document.SelectAll()

    this selects all text ^.^

  • myStreamWriter not declared

  • @gerbilplay4 Same problem here

    Do u know wat to do?

  • @M4C109 Nah, i gave up..

  • And For Delete: Private Sub DeleteToolStripMenuItem_Click(­ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeleteToolStripMenuItem.Click

    Delete: Document.ResetText() End Sub

  • When i write document.copy ()

    It says me that DOCUMENT DOESN´T EXISTS

  • document.copy ()

    without the space after copy then it will work^^

    like so

    document.copy()

    Best Regards Slang

  • I think document is the name of this rich text editor.

    Change document to the name of your rich text editor.

  • Oh!!! Yeah, :) but the only problem, its that im making a WebBrowser with a TabControl, but u don´t know how to use the Copy option in the Tab Control.

    P.S. Sorry about my english :(

  • Well it depends on what you are trying to copy from.

    If its a text box then its the same code.

  • My vb 2008 don`t know dokument.Redo() ... please help^^

  • it's DOCUMENT not dokument

  • lol it's document.Redo()

  • I figured the things youve done out, but i dont know how to make a texteditor such as word, which can handle more fonts etc.

    I mean, that I can make a title with Times New Roman, and then add a line with Verdana. If you know what i mean, please answer :)

  • Make the menu item or button for it (like "Font..."). In the code for that item type:

    Dim FontDlg As New FontDialog

    FontDlg.Show()

    Try  RichTextBox1.Font = FontDlg.Font

    Catch ex As Exception ' Do nothing, either and error occured or the user canceled

    End Try

    The dialog has a list of available fonts.

  • People, think. If you change the GLOBAL font of the textbox, then the whole text will change. I cant make a text with parts "Times New Roman" and "Verdana" and THATS what i want.

    Thanks anyway.

  • You should have spoken clearer.

    Drewjoshd is correct.

    When you said "I mean, that I can make a title with Times New Roman, and then add a line with Verdana", I though you meant you already could, and you want to know how to change it globaly.

  • @killdude69

    there is only one problem I have found and that is that when you try to save over or replace a file the text editer just ads what u hav written to the end of the file rather than replacing it

    please help me fix this and thanx in advance

  • @killdude69 FontDlg.Show() does not work.Error 'Show' is not a member of .Windows.Forms.FontDialog'. What should I do? Thank you

  • or you can do:

    Dim FontDlg As New FontDialog

    FontDlg.Show()

    Try RichTextBox1.selectedtext.font = FontDlg.Font

    Catch ex As Exception

  • Thanks!

  • Whats up killdude69!

    Thanks for the codes! I only needed the save file code although because I have a complete different method of saving a document for our word processor. I am using the simple save code for another project. Thanks!  Ppl who have watched this video need to atleast leave some feedback and I thank you for uploading a tutorial.

  • For the Edit functions it says in the code that the document is undeclared. can someone help me with this?

  • ATTENTION EVERYONE (because many have had this problem)

    document = THE RICHTEXTBOX

    So like:

    document.Text = "Hello World!"

    I hope this helped you, and everyone else who has had this problem.

    I am sorry for the confusion, I should have mad it more clear.

    Regards, killdude69

  • hey..u didnt post on how to load a file and I always get this error :"Name document is not declare" Pls help me:( thks

  • There is a comment above yours by me that explains it.

  • What about the Exit button?

  • thats easy simply

    double click on Exit and type end thats it

  • You must have forgot the line:

    Dim Save As SaveFileDialog

    Read the code dude, instead of asking, re-watch the part where I cover this.

  • Thanks killdude, it works perfectly without any trouble.

    It is easy to miss one brachet and then code does not work, some practise will help avoiding those errors and most important is to think while typing, why command gives certain effect, that way it is rather easy to learn VB as it is quite logical and simple language.

    I did like how you used notepad, much easier for me as english is not my 1st language.

  • dude i save a txt file open it in notepad and nothings is there

  • Save EPICALLY FAILS.

  • everywhere it says 'Save' it says its not declared

    hlp???

  • You see line Dim Save As ..... in your code?

    There you declare name "Save", it is like giving name to virutal 'box' that holds stuff, that 'box' is called variable. That way it become easier to understand to me.

    Make sure your Dim is in correct place, when you double click save, cursor is right where that text should read.

    Hope that helps a bit.

  • Good tutorial, overall.

    I think that some sound would greatly improve this, however. If you just talked instead of typing in Notepad. I thought Cam Studio could record sound?

  • Comment removed

  • this works great but if I save a file and then open it back up, i have to open it 3 times before it finally works. :S

  • Awesome, that ought to save me several hours of fiddling around, I'm planning on making a text editor with unicode support, where I can control the background color. This is enough to get me started and well on my way . . .

  • Comment removed

  • i´ve got an error by:

    mystreamwriter ??

    whyy??

  • carry on writing the code and it will go, its because mystreamwriter hasn't been used yet

  • what with exit ?

    but , Thx DDD man !

  • To yanai21:

    To close the program this code:

    Me.close()

  • double click exit, then type "end"

  • mystreamwriter

    what is is the problem ?

    he wil dont working

  • This is amazing! Works Like a dream!

  • why do i get Error1'CheckFileExisits' is not a member of 'System.Windows.Forms.OpenFile­ Dialog'?

  • you spelled EXISTS wrong its CheckFileExists not CheckFileExisits

  • Sorry for the typo, I AM only human after all. I am sure others will realize it is a typo and not an error.

  • At the last part you can see that this function is not included.

  • Is there any code if you close your application. That the programs ask to your user if you want to save your data. If it's changed?

  • You can try and put a message box with OK and Cancel. If they click OK it performs the save function if they click Cancel it closes it.

  • The videos are awsome, they are good quality, easy to follow, and works really well.

    I would give this and the first part 5/5!

  • Comment removed

  • Where Did Document Come From???

  • from the last part

  • Okay what about the Exit ?

    What happened to that?

  • me.close()

  • cool thanks.

  • i got 10 errors:@

  • Well I made a new project called document but now it says document is not a member of text. I really need help!

  • Everytime I type document it gives me an error saying document is not declared help!

  • Thanks! I needed this for my web browser that have a function to open a tab with the websites code, and now the function have a save button to!

  • Good vid! 5 stars!

  • dude! good vid. keep making more, 5 stars ans i subscribed.

  • how do i make a real programm of it? i mean with a exe

  • You can either publish it or get the debugging executable. I prefer the debug exe.

    You can grab it buy going to your project folder, clicking on a folder that says 'debug', and grab an exe file named the same as your project.

  • Right-click on your project and click build

  • Thank goodness for those ready-made methods in the rich textbox control for undo and redo, huh?

    I'm currently tinkering with a program with a variety of different controls which don't support undo and redo in a similar manner, so I "rolled my own" routines for undoing and redoing several changes the user makes...

  • THX SOOO MUCH YOU F***ING PWN

  • did you add a module? because theres an error within the document variable!

  • TextBox1.Text (or whatever textbox your writing in..)

  • Any 1 know how to get a print button???

  • Why do you want a print button?

    If you want to print then use notepad or right click the saved file and click on print.

  • This video was really good, but you didnt do the Exit button and is there anyway you can at like a font button?

  • Exit Button/MenuItem: Me.Close()

    Font Button/MenuItem:

    ------------------------------­--

    Dim TF As New FontDialog

    TF.ShowDialog()

    Try YourRichTextBox.Font = TF.Font

    Catch ex As Exception ' The dialog failed or the user cancelled

    End Try

  • wanted to ask the same question but saw this here :D

    thanks for the font source code

  • can u post the code

  • Lol, you spelled "Knowledge" wrong at first.

  • can you help me? i don't know how to have a "Find" button in my program....can you give me the code?

  • That wasn't convered in this tutorial.

  • is it in any tutorial?

  • what if i wanted to have a New function? what code?

  • add some music next time

    anyways nice tutorial

    i like it

    i have my own universal flash trainer with browser and a text editor

    for the text editor i followed your tutorial

  • problem with the redo action, i write the code exactly, but it says that

    "redo' is not a member of 'System.Windows.Forms.Textbox'­."

    can u help me plz?

  • That is because you were supposed to use a 'RichTextBox', not a TextBox. TextBoxes can't use the Redo action.

  • oh,lol thanks

  • thanks man, great help :)

  • Anyone post the Save code please?

  • lol where's the exit funtion ?

  • Exit function is double click on exit and type end by the way.

  • or "me.close"

  • Nice, Really great video man its very useful :D

  • YAY i did it, great tut

  • yo man great vid....5 stars....but i have one problem:

    my save code looks exactly like your but i have on error that says:

    Error 2 Name 'document' is not declared.

    which refers to the line:

    myStreamWriter.Write(document.­Text)

    can you help me? much thanx

  • the name 'document' is the name of the RichTextBox.

    I can help you 2 ways:

    1. Send me a message if you want to download the fully functional project & source code.

    2. If not, send me a message with details and I'll help trouble-shoot it.

  • Hi. Like the tutorial v much. All works fine, except when doing the following;

    1) Open a text file

    2) Delete 1 or more characters

    3) save and reopen

    The deleted characters re-appear, along with some duplicates of existing charaters. Is this because the code uses File.AppendText? If so how can I modify to allow full editing/deleting?

    Rgds

    James

  • I have uploaded the new source code and project to plunder. It keeps the original text and appends all of the charcters in the textbox to the very bottom. However I cannot post the url in a comment. So you must message me to get the download link.

  • Ey, i really like your guide here but i get a errors'

    1 = Expression Expected

    2 = Leading '.' or '!' can only appear inside a 'with' satement

    Can you help me with it :D?

  • I suggest you message me about problems. It's easier to reply and makes my help to you more personalized. Also you can send me the problem code. Message me the problem with your code and I'll troubleshoot it.

  • What screen recorder do you use?

  • I use cam studio.

  • thanks alot, I'm using these features in a web browser!:) unique one! the best!

  • THANK YOU SO MUCH!! A MASTERPIECE!! :D

    Sincerely, F2army :D :D

  • Thank you, it means alot!

  • when i write on it then save it as txt, and then open with note pad, instead of spaces, i get little box in every space. any help please? and also on the inmediate window i get: "A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll

    A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll

    A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll"

    know what could be causing the error?

  • Well, the space thing is because the richtextbox usually is used to write .rtf format files. Use the textbox control for the tutorial and see if it works better. Also, if you use the textbox, it can undo but not redo.

    About all of the exceptions, I don't know. Maybe you could send me the project? Message me if you want to send me your project. I'll give you my email.

  • Thank you! I closed VB and when I reopened it, the errors were gone! Anyway thank you for offering your help, and anything I'll let you know!

  • I Succeed For Font!

  • ??? what is your problem. Quit wasting yours and my time.

  • You Fail For Font!

  • I do not think the font I used has anything to do with the learning experience. If you're going to give constuctive critisism make sure it is "constructive". Not just being picky because I didn't use your favourite font. Now excuse me, I have a life to get back to.

  • hi. at first thank you for the tutorial nice to understand :)

    but i have question. why does the line "Do Nothing on Exception" mae a error? i have the german edition. it something like syntaxerror. can`t somebody help me? post here or send me a e-mail. THX

  • okey sorry the next time i watch first the whole video then i do stupid questions :D

  • Yeah, it was just a comment in the script.

    And I'm glad you liked the tutorial.

    If anybody needs help with VB 2008 just message me.

    Also, I am doing Visual C++, Visual C#, and Visual Web Develper 2008 express ed.

    Once I get good at them I will start posting tutorials. I already know how to make a webbrowser with Visual C#. I can post a tutorial.

  • ok now whats the code to clear text ?

  • I am sorry I didn't include this on the tutorial, but I was going for a simple text editor just for people to get he basics.

    Just assign a value to the document like this.

    document.Text = ""

    That will clear every bit of text.

  • And For the Couler for when you write

    + Add my msn

  • Okay, here is the color code.

    Dim FC As New ColorDialog

    Try FC.ShowDialog() document.ForeColor = FC.Color

    Catch ex As Exception 'Again, do nothing on exception

    End Try

  • Yes it worked mate but what would the code be to clear the text ?

    is it Ritchtextbox.text = "" ?

  • Kilduse i got your message but in the code i get a error on the code bit "document"

  • Make sure "document" is the name of your RichTextBox.

    Also make sure that the code is in Form1.

    Then, check for any spelling errors.

    If you still get an error, tel me exactly what the error msg says.

  • Can you help me

    i want it so you can change your font style to bold by putting the code into the button so then in the text box when i click the button BOLD ON it will Go Bold and i need one for the BOLD OFF

  • Okay, make the menu item or button (whichever you prefer) and put the following into the code:

    Dim FS As New FontDialog

    Try FS.ShowDialog() document.Font = FS.Font

    Catch ex As Exception 'Do nothing on exeption

    End Try

  • the code for open

  • The code for open is in the first part.

    The code for save is in the second part.

    In the second part of the tutorial I accidentaly said the the code I was explaining was the open code.

    If you still need the code for some reason I can send it in a message.

  • link the codes please

  • ???

  • do you have the code for Print and Exit?

  • I only have the code for exit.

    In the exit buttons codejust type: End

    This will close the app and end all processes.

  • thank you very much

    its really easy to undersand ;)

  • Thank you, I have another good tutorial if you want to see it. it is for a webbrowser

    it teaches you how to create a progress bar, a status bar, open a local webpage, and recent history.

  • yeah thx is really nice ;)

    it helped me a lot...

    thank you very much

  • Everybody, if you have a question or need help. Then message me. I have a higher priority for messages. :)

    Please subcribe to my tutorials.

    It is a great way to encourge me to create more that will help you with your project.

  • Exactly "stupidGayLoginCrap" (funny name dude)

    The name of the Richtextbox can be whatever you want it to be. I just used document for an example.

    Maybe I should've kept the origonal name VB gave it to avoid this such confusion. Sorry about that.

    I would like everybody to know that I am working on a new tutorial. It is for a somewhat complex webbrowser.

    The webbrowser tutorial will teach you how to add a progress bar, status bar, open webpage on harddrive, and use recent browse history

  • you first have to name the richtextbox Document other wise it doesnt know what your talking about. or you can just keep the name richtextbox1.text. like this

    Richtextbox1.Text = myStreamReader.ReadToEnd()

  • Hey I was wondering if you got my last messages sorry for being so pushy

  • no problem

  • hey I figured it out! Document is the name of the Rich Text Box

  • Oh, then don't reply to the message I sent you.

    I should of read all of your messages laughingmonkey

  • PLEASE HELP!!!

  • ya i no me to

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more