Click here to Skip to main content
15,917,174 members
Home / Discussions / C#
   

C#

 
GeneralRe: directory path Pin
Pete O'Hanlon13-Feb-11 22:45
mvePete O'Hanlon13-Feb-11 22:45 
GeneralRe: directory path Pin
arkiboys13-Feb-11 23:22
arkiboys13-Feb-11 23:22 
AnswerRe: directory path Pin
Dalek Dave14-Feb-11 0:14
professionalDalek Dave14-Feb-11 0:14 
AnswerRe: directory path Pin
GenJerDan14-Feb-11 0:29
GenJerDan14-Feb-11 0:29 
GeneralRe: directory path Pin
Pete O'Hanlon14-Feb-11 0:34
mvePete O'Hanlon14-Feb-11 0:34 
AnswerRe: directory path Pin
Luc Pattyn14-Feb-11 1:01
sitebuilderLuc Pattyn14-Feb-11 1:01 
AnswerRe: directory path Pin
PIEBALDconsult14-Feb-11 2:00
mvePIEBALDconsult14-Feb-11 2:00 
QuestionCon open wait Pin
Ajay Kale New13-Feb-11 22:01
Ajay Kale New13-Feb-11 22:01 
AnswerRe: Con open wait Pin
Pete O'Hanlon13-Feb-11 22:13
mvePete O'Hanlon13-Feb-11 22:13 
AnswerRe: Con open wait Pin
Luc Pattyn14-Feb-11 0:52
sitebuilderLuc Pattyn14-Feb-11 0:52 
AnswerRe: Con open wait Pin
PIEBALDconsult14-Feb-11 1:42
mvePIEBALDconsult14-Feb-11 1:42 
QuestionUsing DotNetNuke in c# Pin
sarang_k13-Feb-11 20:08
sarang_k13-Feb-11 20:08 
AnswerRe: Using DotNetNuke in c# Pin
Richard MacCutchan13-Feb-11 22:35
mveRichard MacCutchan13-Feb-11 22:35 
Questionprogress bar while switching to new page Pin
Mugdha_Aditya13-Feb-11 18:26
Mugdha_Aditya13-Feb-11 18:26 
AnswerRe: progress bar while switching to new page Pin
Richard MacCutchan13-Feb-11 22:34
mveRichard MacCutchan13-Feb-11 22:34 
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 

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.