Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
AnswerRe: Create a full screen C# program... Pin
AhsanS25-Aug-08 1:14
AhsanS25-Aug-08 1:14 
GeneralRe: Create a full screen C# program... Pin
chaiguy133725-Aug-08 15:14
chaiguy133725-Aug-08 15:14 
AnswerRe: Create a full screen C# program... Pin
Manas Bhardwaj25-Aug-08 1:28
professionalManas Bhardwaj25-Aug-08 1:28 
AnswerRe: Create a full screen C# program... Pin
Hirakawa25-Aug-08 15:13
Hirakawa25-Aug-08 15:13 
GeneralRe: Create a full screen C# program... Pin
Manas Bhardwaj25-Aug-08 20:48
professionalManas Bhardwaj25-Aug-08 20:48 
QuestionHelp me resolve problem! Pin
medop8224-Aug-08 23:31
medop8224-Aug-08 23:31 
AnswerRe: Help me resolve problem! Pin
N a v a n e e t h24-Aug-08 23:44
N a v a n e e t h24-Aug-08 23:44 
JokeRe: Help me resolve problem! Pin
lisan_al_ghaib25-Aug-08 0:14
lisan_al_ghaib25-Aug-08 0:14 
AnswerRe: Help me resolve problem! Pin
Guffa25-Aug-08 1:43
Guffa25-Aug-08 1:43 
GeneralRe: Help me resolve problem! Pin
chaiguy133725-Aug-08 15:18
chaiguy133725-Aug-08 15:18 
QuestionHow to convert a structure data into bytes Pin
kk.tvm24-Aug-08 22:54
kk.tvm24-Aug-08 22:54 
AnswerRe: How to convert a structure data into bytes Pin
DaveyM6924-Aug-08 23:08
professionalDaveyM6924-Aug-08 23:08 
AnswerRe: How to convert a structure data into bytes Pin
N a v a n e e t h24-Aug-08 23:42
N a v a n e e t h24-Aug-08 23:42 
AnswerRe: How to convert a structure data into bytes Pin
lisan_al_ghaib24-Aug-08 23:45
lisan_al_ghaib24-Aug-08 23:45 
GeneralRe: How to convert a structure data into bytes Pin
kk.tvm25-Aug-08 1:09
kk.tvm25-Aug-08 1:09 
GeneralRe: How to convert a structure data into bytes Pin
lisan_al_ghaib25-Aug-08 1:24
lisan_al_ghaib25-Aug-08 1:24 
Questionworkflow Pin
A.firooz24-Aug-08 22:48
A.firooz24-Aug-08 22:48 
AnswerRe: workflow Pin
Brij24-Aug-08 23:51
mentorBrij24-Aug-08 23:51 
AnswerRe: workflow Pin
Manas Bhardwaj25-Aug-08 1:31
professionalManas Bhardwaj25-Aug-08 1:31 
Questionworkflow Pin
A.firooz24-Aug-08 22:46
A.firooz24-Aug-08 22:46 
QuestionI want to know some of the most advantages and disadvantages of WPF in comparison to the Forms Pin
anishkannan24-Aug-08 22:22
anishkannan24-Aug-08 22:22 
AnswerRe: I want to know some of the most advantages and disadvantages of WPF in comparison to the Forms Pin
lisan_al_ghaib24-Aug-08 22:51
lisan_al_ghaib24-Aug-08 22:51 
GeneralRe: I want to know some of the most advantages and disadvantages of WPF in comparison to the Forms Pin
chaiguy133725-Aug-08 15:22
chaiguy133725-Aug-08 15:22 
GeneralRe: I want to know some of the most advantages and disadvantages of WPF in comparison to the Forms Pin
lisan_al_ghaib25-Aug-08 22:38
lisan_al_ghaib25-Aug-08 22:38 
Questionform program problem...................... Pin
madhu Rao24-Aug-08 21:37
madhu Rao24-Aug-08 21:37 
HI ALL ,

I'd a small form program it's showing a error is: The name of the 'form1'does not exist in current content(line:41)


Can u help me.
Advance thanks 'U'
Rose | [Rose]


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace painthello
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
Form form1 = new Form();
Form form2 = new Form();
form1.Text = "Paint Event";
form1.BackColor = Color.MidnightBlue;
form1.Paint += new PaintEventHandler(MyPaintHandler);

form2.Text = "Paint Event2";
form2.BackColor = Color.MistyRose;
form2.Paint += new PaintEventHandler(MyPaintHandler);

form1.Show();
form2.Show();

}
static void MyPaintHandler(object objectSender, PaintEventArgs pea)
{
Form form = (Form)objectSender;
Graphics grp = pea.Graphics;
String str;

if (form == form1)/// here the error:The name of the 'form1'does not exist in current content
{
str = "hello from the first paint event";
}
else
str = "hello from the second paint event";

//str = "hello from the" + form.Text;
grp.DrawString("HELLO,WORLD!", form.Font, Brushes.BlanchedAlmond, 3, 8);
}
}
}

madhu

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.