Click here to Skip to main content
15,896,207 members
Home / Discussions / C#
   

C#

 
QuestionPolyLib Modifying the ToString method Pin
Ryano12113-Feb-11 5:03
Ryano12113-Feb-11 5:03 
AnswerRe: PolyLib Modifying the ToString method Pin
Eddy Vluggen13-Feb-11 6:03
professionalEddy Vluggen13-Feb-11 6:03 
GeneralRe: PolyLib Modifying the ToString method Pin
Ryano12113-Feb-11 7:43
Ryano12113-Feb-11 7:43 
AnswerRe: PolyLib Modifying the ToString method Pin
Luc Pattyn14-Feb-11 1:03
sitebuilderLuc Pattyn14-Feb-11 1:03 
GeneralRe: PolyLib Modifying the ToString method Pin
Ryano12114-Feb-11 2:22
Ryano12114-Feb-11 2:22 
GeneralMessage Removed Pin
14-Feb-11 2:24
Ryano12114-Feb-11 2:24 
GeneralRe: PolyLib Modifying the ToString method Pin
Luc Pattyn14-Feb-11 2:46
sitebuilderLuc Pattyn14-Feb-11 2:46 
Questionerror in passing value from one form to other Pin
aeman13-Feb-11 1:28
aeman13-Feb-11 1:28 
I am using c# window application. I am trying to pass the value of variable from one form to other. But it is giving error:Can any one correct this? thanks in advance.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;

namespace WindowsApplication1

{

    public partial class Form1 : System.Windows.Forms.Form
    {
       
        public  string  frm1; 
    
     Form2 f = new Form2();

        private string stringOnForm1;
        public Form1(string sTEXT)
        {
            InitializeComponent();
            textBox1.Text = sTEXT;
            
            
           
         }


        


        private void Form1_Load(object sender, EventArgs e)
        {


            f.Show();
            f.button2.Visible = false;
            Random rand = new Random();

            Color[] c = { Color.Green, Color.Red };
           // Thread.Sleep(1000);

            this.button1.BackColor = c[rand.Next(0, c.Length)];
            this.button2.BackColor = c[rand.Next(0, c.Length)];

            if (this.button1.BackColor == Color.Red && this.button2.BackColor != Color.Red)
            {


               // Thread.Sleep(1000);
                f.button2.Visible = true;
                f.s = "1 Message received";
                f.s1 = "ur gas is being leaked";

            }

            else if (this.button2.BackColor == Color.Red && this.button1.BackColor != Color.Red)
            {
                //Thread.Sleep(1000);
                f.button2.Visible = true;
                f.s = "1 Message received";
                f.s1 = "ur electric is being leaked";

            }

            else if (this.button1.BackColor == Color.Red && this.button2.BackColor == Color.Red)
            {
                //Thread.Sleep(1000);
                f.button2.Visible = true;
                f.s = "2 Messages received";
                f.s1 = "ur electric and gas is being leaked";

            }

           


           

        
        
        }

        

        private void button1_Click(object sender, EventArgs e)
        {

          
        }

     private void button2_Click(object sender, EventArgs e)
     {

     }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        } }



Error:
No overload for method 'Form1' takes '0' arguments
AnswerRe: error in passing value from one form to other Pin
Wendelius13-Feb-11 1:49
mentorWendelius13-Feb-11 1:49 
AnswerRe: error in passing value from one form to other Pin
Luc Pattyn13-Feb-11 1:52
sitebuilderLuc Pattyn13-Feb-11 1:52 
QuestionPlease can someone do me a favour and run a C# test for me Pin
Dave Midgley12-Feb-11 23:49
Dave Midgley12-Feb-11 23:49 
AnswerRe: Please can someone do me a favour and run a C# test for me Pin
OriginalGriff13-Feb-11 0:36
mveOriginalGriff13-Feb-11 0:36 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
Dave Midgley13-Feb-11 6:05
Dave Midgley13-Feb-11 6:05 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
OriginalGriff13-Feb-11 6:08
mveOriginalGriff13-Feb-11 6:08 
AnswerRe: Please can someone do me a favour and run a C# test for me Pin
PIEBALDconsult13-Feb-11 3:22
mvePIEBALDconsult13-Feb-11 3:22 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
Dave Midgley13-Feb-11 6:06
Dave Midgley13-Feb-11 6:06 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
OriginalGriff13-Feb-11 6:09
mveOriginalGriff13-Feb-11 6:09 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
Richard MacCutchan13-Feb-11 6:24
mveRichard MacCutchan13-Feb-11 6:24 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
PIEBALDconsult13-Feb-11 14:58
mvePIEBALDconsult13-Feb-11 14:58 
AnswerRe: Please can someone do me a favour and run a C# test for me Pin
Dave Kreskowiak13-Feb-11 10:59
mveDave Kreskowiak13-Feb-11 10:59 
GeneralRe: Please can someone do me a favour and run a C# test for me Pin
Dave Midgley13-Feb-11 20:19
Dave Midgley13-Feb-11 20:19 
QuestionVariable to be Accessed throughout code [modified] Pin
MWRivera12-Feb-11 16:37
MWRivera12-Feb-11 16:37 
AnswerRe: Variable to be Accessed throughout code Pin
OriginalGriff12-Feb-11 21:21
mveOriginalGriff12-Feb-11 21:21 
GeneralRe: Variable to be Accessed throughout code Pin
MWRivera13-Feb-11 4:07
MWRivera13-Feb-11 4:07 
GeneralRe: Variable to be Accessed throughout code Pin
OriginalGriff13-Feb-11 5:42
mveOriginalGriff13-Feb-11 5:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.