Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two form (normal and add value)and one radio button and one combo box in normal form when we checked the radio button the add value form will be open and after that i have one text box and a datagrid view and two button when we enter the value in the text box then that value add to the data grid view by pressing the addvalue button and after inputting value in the datagrid view in the same page i have another button (ok) whern i press ok button that value come in to the normal form in the combo box (means my first form).But Remember which i inputting value in the addvalue form does nopt save in the addvalue form that value value comes in the normal form of the part of combo box and after that save.
Posted
Comments
Chris Maunder 10-Oct-13 8:13am    
You'll need to show some (brief!) code for us to help. You haven't given us anything concrete with which we can help. First, state the exact question you want answered in the title, then post the specific bit you're having a problem with in the body of your question.

1 solution

Trying to wade through that is painful! Please, in future, consider using at least some punctuation...if we can;t read your question, we can't answer it. :laugh:

So, you have two forms:
Form1
   Radio button 
   Combobox

Form2
   Textbox
   DataGridView
   ButtonOne
   ButtonTwo
   OKButton

You display Form2 when the user checks RadioButton in Form1.
You enter data in the DataGridView and press OK. At this point you want to transfer information from the DataGridView to the Combobox in Form1.

There are a couple of ways to do this: If you use ShowDialog to display Form2, then just let the OK button close Form2, and pick up the new data via properties in teh Form1 code:
VB
Dim f2 As New Form2()
f2.ShowDialog
' Use f2.Properties here to access the new values

If you use Show to display the new Form2 instance, then it's more complex: you need to create an event in Form2 which Form1 handles, and then access the Form2 properties in the handler method, using the sender parameter to identify the Form2 instance.
 
Share this answer
 
Comments
neha from Allahabad 11-Oct-13 1:12am    
Hello Sir it is not working.........Can you please write a proper code................
OriginalGriff 11-Oct-13 3:47am    
"it is not working" is not a helpful error report! :laugh:
Show me exactly what you implemented - relevant parts only, please, not your whole program - and tell me what it did or didn't do!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900