Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,092 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,819 people online right now. Registration is fast and FREE... Join Now!




Need help with a text box? vb2008.net

 
Reply to this topicStart new topic

Need help with a text box? vb2008.net, Visual Basic 2008.net need help with a text box

StealthTools
29 May, 2008 - 12:12 PM
Post #1

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
Hi, I want to makee a text box that saves itself within my web browser I made in Visual Basic 2008 Express Edition..

I have a RichTextBox1 that I corrently use to make notes in while I play my games..

How would I save the text in the RichTextBox1, so when I open the browser again the text is there..?

I could make a button to the side of the RichTextBox1 and add code to it to umm. I think you would have to create a file and save the text in that file and when another button is pressed anything in that file is outputted to the browser RichTextBox1? I don't know, lol..

I hope what I have here is understandable..

Thanks for any help!

ps: This isn't for a school assignment or anything... out for the summer.. and doing this for fun tongue.gif

This post has been edited by StealthTools: 29 May, 2008 - 12:15 PM
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Need Help With A Text Box? Vb2008.net
29 May, 2008 - 12:59 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Use a StreamWriter object to write the text to a file. And then on Load, use a StreamReader object to read the text file and put the data into your RichTextBox.
User is offlineProfile CardPM
+Quote Post

StealthTools
RE: Need Help With A Text Box? Vb2008.net
29 May, 2008 - 02:20 PM
Post #3

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(jayman9 @ 29 May, 2008 - 01:59 PM) *

Use a StreamWriter object to write the text to a file. And then on Load, use a StreamReader object to read the text file and put the data into your RichTextBox.



I don't understand how to use that? it is like 4 lines of code... i'm a newbie at this..
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Need Help With A Text Box? Vb2008.net
29 May, 2008 - 02:34 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Here is an example of reading a text file


vb

Dim contents As String = String.Empty
Using StreamReader reader = New StreamReader("C:\MyFile.txt")
'Make sure we have data to read
Do While reader.Peek() <> -1
'On each iteration of the loop we write the next line
contents += reader.ReadLine()
Loop

'Now we write the contents to a RichTextBox
rtbSample.Text = contents
End Using

User is offlineProfile CardPM
+Quote Post

StealthTools
RE: Need Help With A Text Box? Vb2008.net
29 May, 2008 - 04:23 PM
Post #5

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
Using RitchTextBox1 and Button13 and Button14 could you make Button13 save the text in RitchTextBox1 and Button14 load the saved text back into RitchTextBox1?

Could anyone code this for me so I could easily slip it into my program?

This post has been edited by StealthTools: 29 May, 2008 - 04:27 PM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Need Help With A Text Box? Vb2008.net
29 May, 2008 - 08:30 PM
Post #6

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I'm really sorry but we're not going to do your programming for you. You've been given excellent tips and examples, now you just need to work on it. We will gladly help, we have no problems with that, but we're not just going to code it so you can copy & paste it into your application, thats not what Dream.In.Code is for.
User is offlineProfile CardPM
+Quote Post

StealthTools
RE: Need Help With A Text Box? Vb2008.net
30 May, 2008 - 04:04 AM
Post #7

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(PsychoCoder @ 29 May, 2008 - 09:30 PM) *

I'm really sorry but we're not going to do your programming for you. You've been given excellent tips and examples, now you just need to work on it. We will gladly help, we have no problems with that, but we're not just going to code it so you can copy & paste it into your application, thats not what Dream.In.Code is for.



Well I am terribly sorry that I have no idea how to code Visual Basic (except for simple stuff) and that you guys do not want to help me learn this language. I am switching to another forum where the people love to code and will help me learn in any way they can, because they are just good people who love what they do.

And if I did code some junk it would be wrong anyway, and someone would have to correct it.

This post has been edited by StealthTools: 30 May, 2008 - 04:06 AM
User is offlineProfile CardPM
+Quote Post

StealthTools
RE: Need Help With A Text Box? Vb2008.net
30 May, 2008 - 05:24 AM
Post #8

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
For those of you surfing the web and want to know hot to do this.. here's the code that "VBForums.com" eagerly typed for me:

CODE
1.
      Public Class Form1
   2.
      
   3.
          Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
   4.
              Me.RichTextBox1.SaveFile("C:\Documents and Settings\mas111\Bureau\test.txt")
   5.
          End Sub
   6.
      
   7.
          Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
   8.
              Me.RichTextBox1.Clear()
   9.
              Me.RichTextBox1.LoadFile("C:\Documents and Settings\mas111\Bureau\test.txt")
  10.
          End Sub
  11.
      End Class


Thanks to "VBForums.com" for allowing me to learn how to do this. It is alot easier than I thought it would be.

This post has been edited by StealthTools: 30 May, 2008 - 05:24 AM
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Need Help With A Text Box? Vb2008.net
30 May, 2008 - 05:33 AM
Post #9

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Hey lookie, StealthTools didnt even have to try, he just went and found a forum where he can cry and whine and people will do his work for him, isn't that just sweet?
User is offlineProfile CardPM
+Quote Post

RodgerB
RE: Need Help With A Text Box? Vb2008.net
30 May, 2008 - 05:45 AM
Post #10

D.I.C Lover
Group Icon

Joined: 21 Sep, 2007
Posts: 2,166



Thanked: 17 times
Dream Kudos: 2200
Expert In: Dot Net Technologies

My Contributions
QUOTE(StealthTools @ 30 May, 2008 - 10:04 PM) *

Well I am terribly sorry that I have no idea how to code Visual Basic (except for simple stuff) and that you guys do not want to help me learn this language. I am switching to another forum where the people love to code and will help me learn in any way they can, because they are just good people who love what they do.


Nobody here wants to help you copy and paste code written by others without you showing some sort of effort to resolve the problem yourself. We do not give fully functional apps, we give answers to problems, it is your job to implement these answers and turn them into solutions.

We want you to help yourself learn the language by fiddling and experimenting with the code, rather than asking for it as it is much more beneficial for you; we aim to please those who like to help themselves.

QUOTE(StealthTools @ 30 May, 2008 - 10:04 PM) *

And if I did code some junk it would be wrong anyway, and someone would have to correct it.


Nobody learns something as complex as programming in a day, and with that attitude you're never going to learn anything.

By now you should have learnt to read the programming forum rules before asking questions and demanding answers.

QUOTE(StealthTools @ 30 May, 2008 - 10:04 PM) *

eagerly typed for me


I lol'd.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Need Help With A Text Box? Vb2008.net
30 May, 2008 - 07:12 AM
Post #11

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
QUOTE(StealthTools @ 30 May, 2008 - 06:24 AM) *

It is alot easier than I thought it would be.

This is something we already knew and had you put forth even a smidgen of effort, you would have very quickly realized this yourself. In addition, you might even have learned something.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 12:08AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month