+ Reply to Thread
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Advanced Notepad in VB 2008

  1. #1
    Join Date
    Nov 2008
    Location
    Kosovo.
    Posts
    2,391
    Rep Power
    30

    Advanced Notepad in VB 2008

    Hello CodeCall ..

    Today i'm Gonna show how to make an advanced Notepad in Visual Basic 2008 Express Edition ...

    The Notepad will look like this photo ..


    Let's Start ..

    Create a Project
    Increase the Size of Form1 and Rename with " Your Name.. Notepad "

    Make a Rich Text Box and size like in photo ..



    As u see in photo u need a little Space There ...

    After That you should create some Menu Strips In The Little Space that you let in the picture Above ..
    These Menu Strips will look like this ..



    The menu Strip with the name File , make like this photo ..



    So Let's Work here ..

    1.Code For the menu Strip named NEW will be ..
    Code:
    RichTextBox1.Text = ""
    2.Code for the menu Strip named Open we should add an OPENFILEDIALOG from ToolBox and the code is

    Code:
            Dim AllText As String = "", Lineoftext As String = ""
            OpenFileDialog1.Filter = "All Files |*.*"
            OpenFileDialog1.ShowDialog()
            If OpenFileDialog1.FileName <> "" Then
    
            End If
            Try
                FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
                Do Until EOF(1)
                    Lineoftext = LineInput(1)
                    AllText = Alltext & LineOftext & vbCrLf
                Loop
                RichTextBox1.Text = AllText
            Catch
            Finally
                FileClose(1)
            End Try

    3.For the menu Strip named SAVE we should add an SAVEFILEDIALOG from ToolBox and the code is

    Code:
            SaveFileDialog1.Filter = "TextDocuments |*.txt |All Files|*.*"
            SaveFileDialog1.ShowDialog()
            If SaveFileDialog1.FileName <> "" Then
                FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
                PrintLine(1, RichTextBox1.Text)
                FileClose(1)
            End If
    4.For the menu Strip named PRINT add a PRINT DIALOG from toolbox and the code is

    Code:
            Dim AB As New PrintDialog
            Try
                AB.ShowDialog()
                RichTextBox1.Text = AB.PrintToFile
            Catch ex As Exception
                'Again, do nothing on exception 
            End Try
    5.For the menu Trip EXIT code is
    Code:
    End
    after that just Add a Numeric UpDown (no in the RichTextBox)..

    Now let's go to the menustrip EDIT that looks like this ..



    1.For the UNDO code is
    Code:
        RichTextBox1.Undo()
    2.For the REDO code is :
    Code:
        RichTextBox1.Undo()
    3.For the CUT code is :

    Code:
        RichTextBox1.Cut()
    4.For the COPY code is :
    Code:
        RichTextBox1.Copy()
    5.For the PASTE code is :
    Code:
        RichTextBox1.Paste()
    6.For the SELECT ALL code is:

    Code:
        RichTextBox1.SelectAll()
    7.For the CLEAR ALL code is :

    Code:
        RichTextBox1.Text = ""
    Go To the menustrip named FORMAT that will look like this ..




    1.For the menustrip named FONT add a FONTDIALOG and the code is
    Code:
            Dim FS As New FontDialog
            Try
                FS.ShowDialog()
                RichTextBox1.Font = FS.Font
            Catch ex As Exception
                'Do nothing on exeption
            End Try
    2.For the menustrip named COLOR adda a COLORDIALOG from toolbox , code is
    Code:
            Dim FC As New ColorDialog
            Try
                FC.ShowDialog()
                RichTextBox1.ForeColor = FC.Color
            Catch ex As Exception
                'Again, do nothing on exception
            End Try
    ...
    Finally , Test it ..

    Best Wishes ,
    Mendim.

    Notepadi.rar

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Jordan Guest

    Re: Advanced Notepad in VB 2008

    Very neat! +rep

  4. #3
    Join Date
    Jul 2006
    Posts
    16,491
    Blog Entries
    75
    Rep Power
    143

    Re: Advanced Notepad in VB 2008

    Nice job. It's things like this that make languages meaningful
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    Join Date
    Oct 2008
    Posts
    4,060
    Blog Entries
    6
    Rep Power
    45

    Re: Advanced Notepad in VB 2008

    Good tutorial, +rep.
    Interested in participating in community events?
    Want to harness your programming skill and turn it into absolute prowess?
    Come join our programming events!

  6. #5
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Re: Advanced Notepad in VB 2008

    Stunned, VB is sure really good language, also good work mendim !

  7. #6
    Join Date
    Oct 2008
    Posts
    4,060
    Blog Entries
    6
    Rep Power
    45

    Re: Advanced Notepad in VB 2008

    The .NET Framework, and all languages in general that target it are stunning.
    *Gets gun out to shoot C/C++/Assembly code purists*
    Interested in participating in community events?
    Want to harness your programming skill and turn it into absolute prowess?
    Come join our programming events!

  8. #7
    Join Date
    May 2008
    Location
    Hell
    Posts
    3,852
    Blog Entries
    4
    Rep Power
    49

    Re: Advanced Notepad in VB 2008

    Quote Originally Posted by Termana View Post
    The .NET Framework, and all languages in general that target it are stunning.
    *Gets gun out to shoot C/C++/Assembly code purists*
    Lol,

  9. #8
    Join Date
    Nov 2008
    Location
    Kosovo.
    Posts
    2,391
    Rep Power
    30

    Re: Advanced Notepad in VB 2008

    Thanks from all ..
    Mendim.

  10. #9
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,174
    Blog Entries
    13
    Rep Power
    114

    Re: Advanced Notepad in VB 2008

    I see you are using a long-winded FileOpen(). Why not just use IO.File.WriteAllText() or go a little more precise and use an IO.StreamWriter?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  11. #10
    Join Date
    Nov 2008
    Location
    Kosovo.
    Posts
    2,391
    Rep Power
    30

    Re: Advanced Notepad in VB 2008

    huhu , don't understand nothing .. :s ..

+ Reply to Thread
Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to make a advanced tabbed notepad in Visual Basic 2010/ 2008
    By CriticalError in forum Visual Basic Tutorials
    Replies: 7
    Last Post: 09-24-2011, 01:32 AM
  2. Charny NotePad 1.0 [Advanced]
    By Charny in forum Member Software/Projects
    Replies: 4
    Last Post: 04-24-2010, 06:40 PM
  3. How Do I Make A Notepad In VB 2008?
    By Cetol in forum Visual Basic Programming
    Replies: 7
    Last Post: 02-07-2010, 12:47 AM
  4. Replies: 1
    Last Post: 11-02-2009, 06:05 AM
  5. Replies: 3
    Last Post: 10-03-2008, 03:21 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts