Ask Experts Questions for FREE Help !
Ask
    albear's Avatar
    albear Posts: 1,594, Reputation: 222
    Ultra Member
     
    #1

    Apr 2, 2009, 11:29 AM
    Ineritence? Include?
    In visual studio 05 I'm using visual basic and on one form (form1) I have a listbox called Pnames and on a different form (form2) I have a textbox where the user inputs their name, on that same form I have a button that when clicked I want the name in the textbox to be added to the list box in form1

    I've been looking for ways to solve this on the internet but when I tried it messed form2 up and I had to redo it again, any help would be greatly appreciated
    Thanks :)
    Perito's Avatar
    Perito Posts: 3,139, Reputation: 150
    Ultra Member
     
    #2

    Apr 2, 2009, 07:31 PM

    Is the name of the listbox known before you compile? I presume it is, but if not, you'll have to use "reflection" to solve the problem.

    If both forms have been created (you have instances to both forms), you can make the textbox Public on the Form1 listbox and access it directly from Form2. I don't like that approach, so I always create a Public Property on Form1. I then use that property from Form2 to pass the value that I want.

    You'll have to pass a Form1 reference to Form2 when it is created. I suggest you use a Public Property to pass that reference also.

    If you need examples, I can probably generate them for you.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

Do I have to include these W2s when I file? [ 5 Answers ]

I have a question. I have multiple W2s, two of which have no Federal or State tax withheld. My wages on them are 206 and 2893 dollars-- my other two W2s I made more money and taxes were then taken out. Why do my two W2s have no taxes withheld? Also, I did my taxes online at Taxslayer-- I...

Prices do not include T/L/F. [ 2 Answers ]

Prices do not include T/L/F. anyone knows what it means when you buying a car

Php remote include [ 2 Answers ]

Hi why won't this code work have I done something wrong? Thanks <html> <head> <title>test</title> </head> <body>

What not to include on a resume [ 0 Answers ]

Is it OK not to include on my resume a job that I had for 3 months which is not relevant to the position for which I'm applying? It was an entry level position that I took after my employer of 20 years went out of business. I took the job until I could find the job I really wanted because I...


View more questions Search