Traverse Data From Form1 To Another Form?
Mar 4, 2009
im working on windows application.In this Application iam using two forms one form is for save and modifying the details of the Patient. This First form contains a 'Find Patient' Button .when we click on button. new form will be open code in the 'Find Patient' button click
'open a form2 from form1
dim f2 as new form2
f2.show
In this form2 iam searching for particular patient according to their Id and retrieveing all the details of the patient in a datagridview wat i have to do is when i click on any cell in datagridview of a particular employee . the details of the particular employee should be shown on the first form1 by hiding this second form2'code in the datagridview_celldoubleclick()
Private Sub grv_Patientdetails_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grv_Patientdetails.CellDoubleClick
Try
[code].....
data will be retreiveing correctly. but it is opening in a new form but already old form1 is opened beneath the form2 ? new form should not be opened and data should be retrieved in the first form which is already opened how should i do this?
View 1 Replies
ADVERTISEMENT
Jun 10, 2009
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Para abrir un formulario independiente /Open independent form
[Code].....
View 2 Replies
Feb 18, 2010
I have a VB class inside which one of the methods accepts an array of forms. For each form inside the array, I need it to traverse all of the objects, check if they are a specific tyoe (input, label, checkbox, etc.) and get the properties of each object. Then, I want to dump these into a text file in the following format:
[Code]...
View 4 Replies
Oct 27, 2009
In my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon
View 2 Replies
Aug 2, 2011
i have my database table in textbox i want to add a comment button when they click on that it should open a new form with another textbox from the same table.my problem is i cannot get it to load the selected rows comment colum.
My table is containing for example, username, password, name, surname and comment
on form1 i have username, password, name and surname with a button that should open form2 with comment with multilines.so if i have selected a username for example test and i click on comment i want to add data to the username test.
View 2 Replies
Jan 30, 2011
All I want is to update the selected row data in form1 to another form2
Form1 Objects
Form1 = MainAppForm
DataGridView = DGVMain <= binded
Button = btnUpdate
Form2 Objects
Form2 = frmUpdate
Button = btnSubmit
15 textBoxes = you can see its name in the code below and all of them are data binded
MainAppForm Code
Pass the selectedrow data to form2 (frmUpdate)
Private Sub btnUpdateDouble_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
If DGVMain.SelectedRows.Count = 1 Then
Try
frmUpdate.ItemIDTextBox.Text = DGVMain.CurrentRow.Cells(0).Value.ToString()
frmUpdate.PartTypeTextBox.Text = DGVMain.CurrentRow.Cells(1).Value.ToString()
frmUpdate.PartNameValueTextBox.Text = DGVMain.CurrentRow.Cells(2).Value.ToString()
frmUpdate.PackageTypeTextBox.Text = DGVMain.CurrentRow.Cells(3).Value.ToString()
frmUpdate.QuantityTextBox.Text = DGVMain.CurrentRow.Cells(4).Value.ToString()
frmUpdate.UnitTextBox.Text = DGVMain.CurrentRow.Cells(5).Value.ToString()
frmUpdate.DescriptionTextBox.Text = DGVMain.CurrentRow.Cells(6).Value.ToString()
frmUpdate.LocationTextBox.Text = DGVMain.CurrentRow.Cells(7).Value.ToString()
frmUpdate.ProjectBoardTextBox.Text = DGVMain.CurrentRow.Cells(8).Value.ToString()
frmUpdate.CommentsTextBox.Text = DGVMain.CurrentRow.Cells(9).Value.ToString()
frmUpdate.OrderCodeTextBox.Text = DGVMain.CurrentRow.Cells(10).Value.ToString()
frmUpdate.CurrencyTextBox.Text = DGVMain.CurrentRow.Cells(11).Value.ToString()
frmUpdate.UnitPriceTextBox.Text = DGVMain.CurrentRow.Cells(12).Value.ToString()
frmUpdate.SupplierTextBox.Text = DGVMain.CurrentRow.Cells(13).Value.ToString()
frmUpdate.ManufacturerTextBox.Text = DGVMain.CurrentRow.Cells(14).Value.ToString()
frmUpdate.Show()
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
ElseIf DGVMain.SelectedRows.Count = 0 Then
MsgBox("Please select one item to update!", MsgBoxStyle.Information, "Update")
Else
MsgBox("Updating multiple Items is not allowed!", MsgBoxStyle.Information, "Update")
End If
End Sub
Form2 Code
I want to update the data by this code, but it refresh only the data in Form1
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Me.Validate()
Me.SparePartsBindingSource.EndEdit()
Me.SparePartsTableAdapter.Update(Me.InventoryDBDataSet.SpareParts)
'Refresh
MainAppForm.SparePartsTableAdapter.Fill(MainAppForm.InventoryDBDataSet.SpareParts)
End Sub
No problem in updating the data if I put the code below in Form2 load event
Me.SparePartsTableAdapter.Fill(InventoryDBDataSet.SpareParts)
but the problem is, it will refresh all the data in the Form2, and my code in Form1 becomes useless.
Thanks in advance!
View 1 Replies
Aug 11, 2011
Im doing this project but u have a problem. im trying to make it so that when a timer in the first form(form1) ticks a progress bar in the other form goes up by 1.
View 2 Replies
Aug 15, 2009
I need step-by-step help in getting a creating a dataset of a single table. I'm able to connect to my SQL2005 server (residing on same machine as code for lack of equipment) [code]...
View 3 Replies
Jan 17, 2011
I have a concatenated string like...
str= 1010,5050,6079
And want to separate the string In Javascript I can do
string = Srt.split(","):
and the result...
string[2]=5050
Is there a way to do this in VB.NET?
View 2 Replies
Sep 9, 2011
Using VB 2008:Situation: A Form1.BackgroundWorker calls a Form1.subroutine. That sub starts a Form1.Timer with Me.tmrOK_BlinkForm.Enabled = True...fires Timer code in event: Public Shared Sub tmrOK_BlinkForm_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrOK_BlinkForm.Tick
Form3.Visible = True
Form3.Label1.Text = gNowButtonDispText
Form3.BackColor = Color.White
Form3.Refresh()
[Code]...
There must be a way to do this, I just need the correct BackgroundWorker Syntax send Stop commad to Form1.Timer from Form3.Click_event...all inside a Form1.BackgroundWorker thread started in Form1.
View 4 Replies
Sep 28, 2011
how to traverse all TableAdapter in xsd file?
I want to change default connectionstring of all TableAdapter objects in xsd at beginning of application,
View 1 Replies
Feb 16, 2009
I have got 2 forms ----- form1 and form2
i wanted to navigate from form1 to form2. and then close form1
i did the following code.
-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub
i also tried -- form1.close() and form1.dispose() but all in vain
Problem is that my form1 is not getting closed
View 7 Replies
Jun 12, 2010
I have an aboutbox1 and form1..I also have a button. When I click the button it runs the backgroundworker. My background worker then opens form1.My backgroundworker doesnt just open it, it does alot of other stuff so don't ask why im doing it like that.My problem:When the background worker opens form1, form1 is not responding.
View 3 Replies
Jun 2, 2011
Well i meant In Form1 theres an object named NUM in which i have Stored Few values Now i want to use this Object NUM in form2 so that i can display its value in Form2.. ima unable to access it in form2.
View 6 Replies
Nov 2, 2009
Im wondering why this doesn't work: It sets initialdirectory to directorypath and doesn't traverse into save folder. I've tried it all. Anyone have any ideas of how to get it to work? [Code]
View 4 Replies
May 6, 2009
Is there any way to pull data from a text box on form1 into form2
For example if Textbox1 = 100
When i click the botton to load form2-
Textbox1 on form 2 ALSO =100?
View 18 Replies
Mar 4, 2009
Is there an easy way (if it can be done at all) of taking data from textbox1 on form1 and placing it into textbox1 on form2?
SO when you hit the button it loads form two and will display the info stored on the origional form1?
View 15 Replies
Oct 21, 2010
Which different abount Form1.Close and Form1.Dispose?
View 1 Replies
May 29, 2012
1) At run-time, i want save form1 as Multi Form(Form1,Form2,Form3..etc) with different data,
2) If click load button then it should show all Forms Name(Form) in the ListBox then when click any Form from ListBox then it should open
View 5 Replies
Feb 5, 2012
I'm got a form in which all my data is displayed in a datagrid view. Part of this assignment is write the individual input transactions to a checkbook type register. Then it needs to allow the user to click on the cell contents and it must open in a window as a summary.I've got the entire program written, except the summary. From main form "checkbook" and the dgv within, i have built a seconary form "details".
[code]...
View 11 Replies
Mar 26, 2012
I'm making an autotyper/spambot, these may seem wrong to a few or most of you but it's a $50 bet to me. But anyway, I have the controls on form 1, (TextBox1 + Start + Stop (user input), ComboBox1 + Start + Stop (For pre-defined input.)) and the pre-defined text on form2. But I have a problem with the combo box reading the data on form 2.
Example:
On timer2_tick
Sendkeys.Send(Form2.textbox1.text)
View 1 Replies
Mar 3, 2009
think i have 2 form & one module..
form1 (has one button name button1)
form2 (also has one button name button1)
[Code]....
View 2 Replies
Dec 1, 2009
I have 2 forms, main Form1 and a loginform. When I start the application, first "Form1" is loaded and then with a button click, user can load "loginform" if required to enable/disable some features/controls on Form1.The sequence is like this:
1) Load main form Form1
2) click a button on Form1
3) Load the loginform.
4) enter user/pwd and click OK button
5) enable/disable "GroupBox" control on Form1 if login sucessful.
For this,I made a click event for OK button in loginform, so once user clicks the OK button, I want to call one function which is defined in Form1 as a Public, which enables/disables the "GroupBox" control on Form1. The code structure is like this:in main Form1, i created a function like this:
Class Form1()
Public Function DoThis() ' Function to enable/disable GroupBox control
....some task...
[code]....
I am not able to call the DoThis() function in loginform. Please suggest me with a piece of code how to do this?? remember that Form1 is my main form which is loading first.
View 5 Replies
Nov 17, 2010
It's a program that reads student data from a text file and displys it in a listbox(Form1). From there on you can add a new student to the textfile by clicking on "Add" button that shows another form(Form2) and you input the new student data into the appropriate text boxes. Afterwards you can press "Add" button(Form2), but the Add Student(Form2) window comes up again with all the inputted data gone, and if I place the new student info into the text boxes again and click "Add", the program jumps back to the Form1 and a message box suppose to say what was added to the textfile, but nothing was added except for empty listbox items.
View 3 Replies
Feb 14, 2011
How can i use Hscrollbar to scroll the data in a database displayed in a textbox1 in my Form1?
View 6 Replies
Apr 8, 2010
I need to be able to start with Form1, move to LoginForm, then back to Form1 taking 2 variables and the "values" they have in the LoginForm back to Form1 and using the variables. I start with the main form (Form1) and have the user enter some information. Once they click OK I have the LoginForm open. After they enter their credentials I will check to make sure they are legal users, then go back to Form1 (here is where I need to take the Username and Password with me) to log onto a server using the same credentails from the login form.
View 1 Replies
Jan 9, 2010
I have these code in my project one from my lecture one that i did myself [code]what is the difference between "dim" something as new form than using the form name straightaway?
View 2 Replies
Jun 6, 2011
I want to display date and time on top of the form where normally written form1 forms name. i want to display date in formate of for example 23 August 2010 and time in this formate 12:33:20AM
View 7 Replies
Mar 11, 2011
is there any way to make the form title(form1.text) moving?like marquee in HTML?
View 2 Replies
Jun 14, 2009
why i cant see the Form Design?and when i double-click the Form1.vb on the Solution Explorer i got error:does anyone here encounter this probz before?how to fix this.. (should i reinstall vbnet?)
View 1 Replies