Jump to content

need a little help here

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
21 replies to this topic

#1
kpelzer123

kpelzer123

    Newbie

  • Members
  • Pip
  • 2 posts
Hi im trying to make an application in visual basic express that will count clicks. i have successfully created the GUI and have several buttons and the app works great! now i have a problem. I have made a menu title bar and created the save dialog box i even went as far as to make the button output to a text file and that works as well. the problem is i have approx 21 text boxes that i need to all save and i need to have a function that i can load a previous save for my application to fill in on each 21 text boxes. i feel that there is some method that i havent tried yet and i have searched far and wide over the net.
Thanks in advance for any help i may recieve

#2
travy92

travy92

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
I don't quiet know what you mean but i'm going to try and help.
I think you mean fill in every text box when you play?

Well if that's the case then try this:

Lets say that the 21 Text Boxes are named Text1, Text2, Text3 etc.
Add a Command Button then this code under Private Sub Command1_Click():

Quote

Text1.Text = "Reply"
Text2.Text = "To"
Text3.Text = "Me"
Text4.Text = "If"
Text5.Text = "This"
Text6.Text = "Works"
Text7.Text = "Lol"

Reply to me if this worked. :D
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]

#3
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well he has to load those from a text file. Well there is one method that I know of, use INI files. Google for Visual Basic and INI files and you will find some information about that. Or else you can save every button text into a new text file, ie having 21 text files.

#4
travy92

travy92

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
Why would he have to load that from a text file?
I have little knowledge in this field. Someone to shed some light would be good :D
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well because he wants to save them, and loads them next time.

#6
kpelzer123

kpelzer123

    Newbie

  • Members
  • Pip
  • 2 posts
thanks guys i appreciate the input.. i ended up sending all data to an excel document to certin cells. the application was for ticket counting (ie each time i clicked a certin button it would add a count. ) i set up each text box to export to a specific cell in excel per for each date. (i added a date text box.;)) then i set it up to load by date from those cells that it transfers to .. i thought this would workout better as i needed the info to go to the document in the end anyway. but i feel this was a good effort for my first project in programming. thanks again :D

#7
o0TheNerd0o

o0TheNerd0o

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts

TheComputerMaster said:

Well he has to load those from a text file. Well there is one method that I know of, use INI files. Google for Visual Basic and INI files and you will find some information about that. Or else you can save every button text into a new text file, ie having 21 text files.

.ini files aren't really used that much anymore. I suggest saving records in the registry. That way you don't have to worry about saving/loading text streams. Its a simple function to save and load registry entries. If you google them, you'll find tons of examples. The registry is best/fastest way to go, and its built into VB.

To save syntax(just replace each parameter with appropriate information):

SaveSetting AppName, Section, Key, Value, [Default]

To get syntax(just replace each parameter with appropriate information):

GetSetting AppName, Section, Key

Option Explicit
:cool:

#8
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts

o0TheNerd0o said:

.ini files aren't really used that much anymore. I suggest saving records in the registry. That way you don't have to worry about saving/loading text streams. Its a simple function to save and load registry entries. If you google them, you'll find tons of examples. The registry is best/fastest way to go, and its built into VB.

To save syntax(just replace each parameter with appropriate information):

SaveSetting AppName, Section, Key, Value, [Default]

To get syntax(just replace each parameter with appropriate information):

GetSetting AppName, Section, Key

Sorry man, but I gotta laugh at this one.. NO COMMENT

Anyways good job kpelzer123, you should feel satisfied that you made this on your own.

#9
o0TheNerd0o

o0TheNerd0o

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts
Why the no comment? Is something wrong with using the registry? Or are you incompetent in using it yourself?
Option Explicit
:cool:

#10
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Hey man what is wrong with you!? Why are you always criticizing?! WTF! Who the hell you think you are!? I just said NO COMMENT for one reason, but as always you got it the wrong way!!

#11
o0TheNerd0o

o0TheNerd0o

    Learning Programmer

  • Members
  • PipPipPip
  • 61 posts
My problem is that you don't know what you're talking about. You contradicted yourself with this one bro. If you use an .ini file, you have to have it with your .exe file. If you use the registry in your code, there isn't any dependency on any outside file. Haha, weren't you trying to avoid this in your other post? With the images? Lol, this is not even fair.
Option Explicit
:cool:

#12
travy92

travy92

    Learning Programmer

  • Members
  • PipPipPip
  • 76 posts
Geez guys, calm down. There's no need to fight in this forum. One of you jsut be the man and say sorry!

Sorry for off-topic!
[SIGPIC]C:\Users\Travis\Desktop\Image Converter\Knight1.bmp[/SIGPIC]