Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

Phil Saville

@Phil Saville
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Passing strings between windows forms
    P Phil Saville

    ahhhh thankyou yes that worked, should really have noticed that, thankyou

    C# winforms help

  • Passing strings between windows forms
    P Phil Saville

    heres 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.

    C# winforms help

  • Passing strings between windows forms
    P Phil Saville

    the 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"

    C# winforms help

  • Passing strings between windows forms
    P Phil Saville

    hi 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.

    C# winforms help

  • Call Stored Procedure Using C#
    P Phil Saville

    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!

    C# csharp database help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups