VS 2008 Accessing Form1 From Form2?
Sep 25, 2011I'm my original post here and the code in post #1HTML why doesn't this work? i get an error on the underlined section.
View 7 RepliesI'm my original post here and the code in post #1HTML why doesn't this work? i get an error on the underlined section.
View 7 RepliesI need to have access to the Listview1 in form1 from form2, something like this:
Form1.Listview1.Items....
Last one day I could not manage to pass data from one form2 other form.
When I am opening Form2 from Form1, I can pass data from Form1 to Form2.
When I am closing Form2, I want to pass data from Form2 to Form1 which is still open when I close form2.
I try to use shared textbox, but I understand that this is nt supported.
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 RepliesI am in the process of creating an excel add-in. I have created a subroutine inside one form. Using a second form, I would like to run the subrountine if the "OK" button is clicked. How do I make this public subroutine availiable between forms?
View 2 RepliesI have a simple problem and I believe that the solution is with module using but I could not resolve it yet. Here is the scene:In Form1 I have a variant that gets its value from the selections of a listbox. The code is:OPtext) in Form2 because this selection from Listbox (in Form 1) should also trigger some events in Form 2. I tried to use a module and declare the variant using Public. I did this and I now can use the variant in Form 2. But the value selected in Form1 does not come to Form 2.
View 7 RepliesI 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
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form2.Show()
Me.Close()
End Sub
i have this code on my MDI parent and on button click i would like Parent to close and form2 to load/show.yet with current code when i click button it closes all the app and doesnt load from2
What im trying to do is load form1 and form2 at the same time.I have a setting called hideform2.So when i run both forms at the start up i want to get it so when they click on a close button and form 2 hides.I want it so when they run the application again it dosent show form2 anymore?
View 5 RepliesOk I have 2 text box on form 1...
Username:
TEXTBOX HERE
Password:
TEXTBOX HERE
The web browser is on form 2...
When I click login, how can I make the username text box text and the password text box text inject into the web browsers username and password text box's on the web browser ON THE OTHER FORM?
IThere's a button on the toolstip that's always enabled for form2 so they are always able to search the database.When a user is on form1 and selects the link button. They are taken to form2 to select criteria to search. On Form3 they choose 1 item in the grid andcan select the Link It button on the form to link the 2 selected grid items (form1 and form3). Since form2 and form3 are available at anytime.my problem is knowing when the Link button on form1 has been chosen and after a successful link to not allow anymore links. Technically, they could pull form2 up via the toolstrip or an existing form2 window and Link as long as Form1 is on the screen but I do not want this. It's as though I need a global variable to set to True/False.
View 1 Repliesi need to pass on some variables from FORM1 in to a procedure in form load event of FORM2 to say in another way i need to run a procedure (which uses variables of FORM1) which is derived in FORM1 class and in FORM2 load event
View 3 RepliesI have 2 forms. On form1 i have listview on form2 i have menu. I'd like to call form2 menu from Form1 ListView1_MouseUp. I tryed to use this code
[Code]...
if in vb.net, I can call like this form2.show (), but how in wpf vb.net?
View 1 RepliesI am having problems making changes to form1 from form2..I tried declaring form1 on form2 Dim f1 as form1.[code]I can change form2 from form1 but not the reverse.
View 5 Repliesthis looks like to the forum I need. I have a question on somethings. My data is pulled from a local SQL sever express. First, Form1(Customer) has has data. his customer has a vehicle in another form this form is called (Vehicle) form.I have created the customer form in a detailed form and the vehicle form on a grid design.
View 1 RepliesI have been converting my VB6 programmes to VB 2008, and I am beginning to regret it.According to the books that I am reading on the subject, I can call a second form from the first one. That is, when the first form code has completed, and the final line reads:
frmForm2.Show()
the second form should open and wait for input.This does not happen, the form flashes and then disappears without allowing any input, or button click.I must admit that I preferred being able to start from a module, with a Main() sub, which then read the forms, a la VB6. everything seemed to work fine then.
I made 2 form.
In form1 I have this:
form2.show()
form2 ends up behind form1, how can I make form2 appear in front of form1?
Form2.showdialog() will make form1 disappear until form2 is closed, that is not what I want.
There is no session in desktop app in vb.net .i want to transfer valuse from one form to other want to transfer form 1 (TextBox1.Text) value on form2 (objuserpage.Label1.Text)
'form 1=userpage.vb
Dim objuserpage As New userpage()
' form 1 textbox TextBox1.Text[code].....
I have a panel to form2 on my form1 which displays a picture box fine. I got a peice of code that stores 5 images in an image list and works off a keypress.
When I press the Comma key the image changes to the next one. This works fine on its own but when I put it in form2 and try to put the keypress code on form1 for it to change image in the panel it doesn't work.
I would like to do 2 things (or one of the two)
first, I have in form1 a textbox1 and i would like to bring the info of it to a textbox (or label) in form2
second, If it's possible i would like to set a picture from form1 to form2 (if that's possible)
In the FORM1, the datagridview contain some product column and user can input the number of product quantities they want to buy.if user press the "buy" button, i want it to open FORM2, with datagridview containing the list of the product they buy from datagridview in FORM1.[code]...
View 1 RepliesI have an equation on Form1.vb that calculates a number. I need that number to be used in another separate formula that's on Form2.vb. How do I do this? I thought using a Module would work but I can't get the function on the Module to "see" the formula and/or variables that I need on Form1.vb. I am using VB 2005.
View 8 Repliesi have here a login in form1 that is connected to my sql database.i want that if i login in form1. the form2 will show my name.
View 11 RepliesI have Form1 that has a textbox and a button. When user clicks the button in Form1, Form2 opens up with a label control that carries the value of textbox in Form1.
What i did is set the textbox modifier of Form1 to Public, but when i call the textbox name of Form1 in Form2, i get an error that says "The name "txtbx1" doesn't exist in the current context". I wonder why since i already set the modifier of txtbx1 to Public.
Quick Note: i tried to instantiate Form1 in Form2 as:
Form1 f1 = new Form1();
and then call
f1.txtbx1.text
The odd thing is Form1 could not be instantiated (not highlighting occurs). On the other hand if i do Form2 f2 = new Form2(); Form2 gets highlighted!
This is how i show Form2 from Form1:
SetSalary salForm = new SetSalary();
salForm.ShowDialog();
Note that SetSalary represents Form2.
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?
How I have centering Form2 inside Form1. CenterToParent() doesn't work.
View 14 RepliesIs 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?
Using VS2008 I created a dataset in the designer and created a table with one column in the dataset. I pulled this table to create a DGV on Form1 and my column appeared (DS & BS were created on the form as well). It is on Form1 that I would like to initially populate the DT. (The DS is internal and does not have a connection string) On Form2 I would like to create a DGV and use the BS on Form1 as the data source. This is not visible, however, from Form2. I can set the data source programatically but then the column is not visible on Form2 until run time and I would like to make my formatting changes on Form2 using the designer. I tried making the DS and BS on Form1 both public but they still are not visible as a data source on the Form2 DGV.Is there a way to make a data source on a form visible to other forms in the project using the designer?
View 3 RepliesI want to create Program which have 2 forms. I want Form2 not out of Form1 region. Example: I have a form with a button. Button1 = Form.show Form2 appear on center the screen and can not exceed size of Form1.
View 2 Replies