Click here to Skip to main content
15,921,989 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Panel Control in visual basic Pin
monica2k11-May-05 16:54
monica2k11-May-05 16:54 
GeneralRe: Panel Control in visual basic Pin
Mitch F.11-May-05 18:03
Mitch F.11-May-05 18:03 
Generalhhhhiii Pin
shekkk11-May-05 13:20
shekkk11-May-05 13:20 
GeneralRe: hhhhiii Pin
Christian Graus11-May-05 13:52
protectorChristian Graus11-May-05 13:52 
Generalhihihi!!!! Pin
shekkk11-May-05 13:03
shekkk11-May-05 13:03 
GeneralRe: hihihi!!!! Pin
Christian Graus11-May-05 13:53
protectorChristian Graus11-May-05 13:53 
GeneralDeclaring variables from class Pin
harrysk11-May-05 6:58
harrysk11-May-05 6:58 
GeneralRe: Declaring variables from class Pin
Dave Kreskowiak11-May-05 7:18
mveDave Kreskowiak11-May-05 7:18 
Of course not. All you did was create a Member object, called it Mem1, set a bunch of properties on it, then forgot about when the Sub finished.

What are you trying to save this object in? You don't have any code in here to save the object anywhere.

You need to store the object somewhere, like in a collection, that was created outside this function you posted. Currently, the Member object you created only exists inside this function.

For instance, if you wanted to create a new TextBox control on a form you could:
Private Sub btnNewTextBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewTextBox.Click
    Dim myNewTextBox As New TextBox
    myNewTextBox.Text = "Some text..."
End Sub

Just like you did with your Member object. But, you'll never see this TextBox to be able to do anything with it because at the end of the function, the new object is detroyed because nothing outside this function can get to it. What you need to do is add it to a collection that was created outside this function. In my example, its the form's Controls collection:
Private Sub btnNewTextBox_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewTextBox.Click
    Dim myNewTextBox As New TextBox
    myNewTextBox.Text = "Some text..."
    Me.Controls.Add(myNewTextBox)
End Sub




RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Declaring variables from class Pin
harrysk13-May-05 0:51
harrysk13-May-05 0:51 
GeneralRe: Declaring variables from class Pin
Dave Kreskowiak13-May-05 0:59
mveDave Kreskowiak13-May-05 0:59 
QuestionHOW WE CLOSE A FORM FROM OTHER END Pin
LAYEEQ AHMED KHAN11-May-05 5:49
LAYEEQ AHMED KHAN11-May-05 5:49 
AnswerRe: HOW WE CLOSE A FORM FROM OTHER END Pin
Colin Angus Mackay11-May-05 5:55
Colin Angus Mackay11-May-05 5:55 
AnswerRe: HOW WE CLOSE A FORM FROM OTHER END Pin
Dave Kreskowiak11-May-05 5:56
mveDave Kreskowiak11-May-05 5:56 
GeneralRe: HOW WE CLOSE A FORM FROM OTHER END Pin
LAYEEQ AHMED KHAN11-May-05 6:00
LAYEEQ AHMED KHAN11-May-05 6:00 
GeneralRe: HOW WE CLOSE A FORM FROM OTHER END Pin
vertig073011-May-05 6:34
vertig073011-May-05 6:34 
GeneralRe: HOW WE CLOSE A FORM FROM OTHER END Pin
Dave Kreskowiak11-May-05 6:46
mveDave Kreskowiak11-May-05 6:46 
GeneralRe: HOW WE CLOSE A FORM FROM OTHER END Pin
Dave Kreskowiak11-May-05 6:50
mveDave Kreskowiak11-May-05 6:50 
AnswerRe: HOW WE CLOSE A FORM FROM OTHER END Pin
Michael P Butler11-May-05 6:23
Michael P Butler11-May-05 6:23 
Generalvb.net 2005 application database package Pin
Yojam11-May-05 5:29
Yojam11-May-05 5:29 
GeneralRe: vb.net 2005 application database package Pin
Dave Kreskowiak11-May-05 5:55
mveDave Kreskowiak11-May-05 5:55 
GeneralRe: vb.net 2005 application database package Pin
Joey Picerno11-May-05 6:13
Joey Picerno11-May-05 6:13 
Generalsending voice over modem, usnig VB Pin
Member 195460811-May-05 4:13
Member 195460811-May-05 4:13 
GeneralRe: sending voice over modem, usnig VB Pin
Dave Kreskowiak11-May-05 5:53
mveDave Kreskowiak11-May-05 5:53 
GeneralCatalin - SQL &VB Pin
Catalin Negraia11-May-05 3:03
Catalin Negraia11-May-05 3:03 
GeneralRe: Catalin - SQL &VB Pin
Colin Angus Mackay11-May-05 3:12
Colin Angus Mackay11-May-05 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.