ahhhh thankyou yes that worked, should really have noticed that, thankyou
Phil Saville
Posts
-
Passing strings between windows forms -
Passing strings between windows formsheres an update of my problem since i have tried to change it a little... i have two simple forms, the first just has just a button on which opens the 2nd form so the 2 forms are open at the same time. On this 2nd form i then have a text box and another button, the user will enter some text into the textbox and then press the button. Once this button is pressed i would like the text to be passed to the first form. I have tried using the following code... Form1:
public partial class Form1 : Form
{
string text;public Form1(string receivedText) { text = receivedText; InitializeComponent(); } private void button1\_Click(object sender, EventArgs e) { Form2 f = new Form2(); this.Hide(); f.Show(); } private void Form1\_Load(object sender, EventArgs e) { if (text == "") { } else { label1.Text = text; } } }
Form2:
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}private void button1\_Click(object sender, EventArgs e) { Form1 f = new Form1(textBox1.Text); this.Hide(); } }
This does not seem to work though and i get the error..." 'Pass.Form1' does not contain a constructor that takes '0' arguments.
-
Passing strings between windows formsthe two forms are open at the same time which is why i am having trouble...i've tried passing them using the constructor but this doesn't seem to work and i just get the error coming back saying..." 'Pass.Form1' does not contain a constructor that takes '0' arguments"
-
Passing strings between windows formshi there, im having trouble trying to pass strings between my windows forms... i have 2 simple forms, the first has a textbox and a button on it, and the second has a label on it. When the user inputs something into the textbox on the first form and presses the button i would like the text in this textbox to be passed to the 2nd form and be displayed as the label text. Any help is much appreciated.
-
Call Stored Procedure Using C#Hi, im new to using stored procedures and i have the following stored procedure... CREATE OR REPLACE PROCEDURE DRL_PROCEDURE2(var_SOURCE_OBJECTID IN varchar2, var_NEW_OBJECTID OUT varchar2) AS BEGIN SELECT MAX(NEW_OBJECTID) INTO var_NEW_OBJECTID FROM DRL_CONVERSION WHERE SOURCE_OBJECTID = var_SOURCE_OBJECTID; END; I want to be able to call this procedure from my windows form application and display the result of the stored procedure into a label or a datagrid using C#...could someone please help me! Thanks in advance!