Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Advanced Notepad in VB 2008


  • Please log in to reply
33 replies to this topic

#13 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 07 January 2009 - 03:12 AM

This code:



It's wrong. shouldn't it be:

    RichTextBox1.Redo()

???


Yes , that's it .. :$
Sorry for mistake ..
  • 0

#14 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 07 January 2009 - 12:44 PM

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

Groan.

You can use the IO.StreamWriter class to write data, it's much better than FileOpen().

Here is a tutorial I wrote about it - http://forum.codecal...text-files.html.

It is in C# but you should be able to convert it easily to VB.
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#15 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 10 January 2009 - 01:06 PM

I understand you Xav ..
Thanks for advice . :)
  • 0

#16 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 11 January 2009 - 07:16 AM

You are very welcome [mutter]stupid n00b[/mutter].

lol
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#17 Guest_OliWilding_*

Guest_OliWilding_*
  • Guest

Posted 04 February 2009 - 01:44 AM

Going to try this later.
  • 0

#18 patopop007

patopop007

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 09 February 2009 - 11:48 AM

wow. this really helped! very nice tutorial
  • 0

#19 mendim.

mendim.

    CC Devotee

  • Just Joined
  • PipPipPipPipPipPip
  • 741 posts

Posted 22 February 2009 - 01:51 PM

Thanks patopop007
  • 0

#20 chili5

chili5

    CC Mentor

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3038 posts
  • Programming Language:Java, C#, PHP, JavaScript, Ruby, Transact-SQL
  • Learning:C, Java, C++, C#, PHP, JavaScript, Ruby, Transact-SQL, Assembly, Scheme, Haskell, Others

Posted 22 February 2009 - 03:45 PM

Hm, nice! Seeing as I haven't used VB much before, I don't understand some code. :-s

This section:

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

What does:
AllText = Alltext & LineOftext & vbCrLf
do? What todes vbCrLf mean? Why the try, catch block?

Also why do you have this code:

If OpenFileDialog1.FileName <> "" Then

End If

? it doesn't do anything. Perhaps explain your blocks of code a bit more. :)
  • 0

#21 TkTech

TkTech

    The Crazy One

  • Retired Mod
  • PipPipPipPipPipPipPip
  • 1144 posts
  • Location:Ottawa, Ontario

Posted 22 February 2009 - 11:46 PM

The .NET Framework, and all languages in general that target it are stunning.
*Gets gun out to shoot C/C++/Assembly code purists*


*Shoots back*
  • 0
Helpful CODECALL Links: Join Us, Guidelines, FAQ, Post a Tutorial

#22 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 23 February 2009 - 08:48 AM

TkTech... I think you misunderstood... he meant that using .NET will leave you stunned and vulnerable. He had to shoot the purists out of self-defense after choosing an inferior weapon :D
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#23 Xav

Xav

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 8356 posts

Posted 24 February 2009 - 12:28 PM

If OpenFileDialog1.FileName <> "" Then

        End If

I agree with chili - what on earth is this supposed to achieve? There's nothing inside the code block!
  • 0
If you enjoy reading this discussion and are thinking about commenting, why not click here to register and start participating in under a minute?

#24 Oniak

Oniak

    CC Lurker

  • Just Joined
  • Pip
  • 6 posts

Posted 24 February 2009 - 02:34 PM

Looks cool, Will try it out.
  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download