Using Multiple Dialog Boxes

Hello, this is my first time posting on here.

I took a class for Visual Basic but never got a chance to get real deep into it. IM currently trying to make a program that I can use to store all my serials for my games and other programs, so that it will be more organized, and possibly eventually try to make it more secured.

I have my main form "form1.vb" I have a dialog box called "AddKey.vb" and another dialog box called "DeleteKey.vb". On form1.vb I have 3 buttons, one labeled Add, one labeled Delete, and one labeled Exit *for apparent reasons*. I then have a drop down combo box and a list box. I want to, after addding keys, be able to select the drop down list box select a game and have it push my serial(s) for that peticular program to the list box.

Well . . . when I push the "add button" it opens up the "AddKey.vb" dialog box. the dialog box has 3 text boxes in it. One to type in the name of the game, and 2 to type in the serial *so that It can compare the both together, kind of like when you create a password it wants you to type it in twice. Well . . . the first box will be added to the variable "Gamename" then the second one will be added to the variable "GameKey1" then the second one will be added to "GameKey2".

I was wondering how do I make the value stored in the variable in the "addkey.vb" dialog box code to variables in the "form1.vb" dialog box code, and also, how should I go about adding these values so that every time I open the program its there. should I use an external text file or 2 text files or what. Im not sure as to what the best rout of action is to take here.


Answer this question

Using Multiple Dialog Boxes

  • Michael Mossman

    alright. I have NEVER played with databases in VB. do you think you all could give me a little help, maybe with a bit of code on how to do it

    also, how would I go about encrypting it, and also how do I make it so that the database is stored in the .exe so it doesnt matter if I move the program,  I will still be able to access everything and modify everything every time I use it

  • hari krishna panda1

    okay, I was talking with someone and they told me that in order to make this program with a database then most likely either I would use access, which would have to be on the computer(s) I use the program on, or Use sql which would store the file to an external database. I dont have access and I DEFINETLY dont want my keys going over the internet like that. How can I make a secure file stored with in the program some how *so I can move it from computer to computer* that stores my values in a secure way without using access or another program I would have to download or a program that would send my information to a server somewhere.

  • IanBlackburn

    You need to write (push) these values from the AddKey.vb (Dialog form) to form1.vb

    Form1.vb calls the AddKey.vb (dialog/form). Make sure this is modal.

    ' Push the values back to form1:

    ' This assumes you have a variables called GameName, GameKey1, GameKey2 that are Pulbic type String in .

    form1.GameName = AddKey.GameName.text

    form1.GameKey1 = AddKey.GameKey1.text

    form1.GameKey2 = AddKey.GameKey2.text

    Once you are done, just before you exit AddKey place this code in the exit routine to send the data back to form1.

    There are other ways to do this; objects to pass values or global varables..... But for now this is probably the best way.



  • fleo

    This is a good senerio for using ADO.NET, databinding, and a database...

    Learning ADO.NET:

    http://msdn2.microsoft.com/en-us/data/aa937699.aspx

    VB Data samples:

    http://msdn2.microsoft.com/en-us/vbasic/ms789075.aspx#data



  • mrmckeb

    M1sterbob wrote:
    then most likely either I would use access, which would have to be on the computer(s)

    Let me clarify something here...to use an Access database you do NOT have to have Access installed on your computer or your end users computer(only the mdb file)...furthermore you are capable of encrypting the database(mdb file) as well as the data that you store in the database...which makes it pretty secure...although nothing is 100% secure ...the scenerio of encryting the data and then encrypting the mdb file would be a tough one to crack for the best of hackers!



  • textman

    I was trying that but my problem whenever I do that or try something else similar to it, it just says that the variable isnt public. Also a friend suggested that I create the program with a database. I dont know much about databases but It would probably be easier to create an access or a sql database through the program. Im not quite sure how to do that yet either, but that way you could just push it through to the database and when you close the add key dialog box it would just push the information out to the drop down box then have it when the content of the drop down box is changed then have it push that to a variable then have it check the variable against the database then push the corusponding code(s) out to the combo box.

    fun project!!

  • Using Multiple Dialog Boxes