Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
GeneralRe: TemplateColumn for DataTable Pin
Expert Coming11-Sep-05 13:26
Expert Coming11-Sep-05 13:26 
QuestionUnhandled Ex..Param Null: Value pen??? Pin
Anonymous11-Sep-05 10:22
Anonymous11-Sep-05 10:22 
AnswerRe: Unhandled Ex..Param Null: Value pen??? Pin
Anonymous11-Sep-05 10:38
Anonymous11-Sep-05 10:38 
QuestionRe: Unhandled Ex..Param Null: Value pen??? Pin
Guffa11-Sep-05 10:42
Guffa11-Sep-05 10:42 
AnswerRe: Unhandled Ex..Param Null: Value pen??? Pin
Anonymous11-Sep-05 10:47
Anonymous11-Sep-05 10:47 
GeneralRe: Unhandled Ex..Param Null: Value pen??? Pin
Guffa11-Sep-05 10:57
Guffa11-Sep-05 10:57 
GeneralRe: Unhandled Ex..Param Null: Value pen??? Pin
Anonymous11-Sep-05 11:03
Anonymous11-Sep-05 11:03 
AnswerRe: Unhandled Ex..Param Null: Value pen??? Pin
Mohamad Al Husseiny11-Sep-05 11:32
Mohamad Al Husseiny11-Sep-05 11:32 
you declared active pen at form level and never Initialized it So when you called DrawComplexNumberA in your Form1_Paint and passed activePen to it you actually passed null value because activePen never initialized before you may say that you initialized it at
private void complexA_OK_Click(object sender, System.EventArgs e)
{
Graphics g = this.CreateGraphics();
<big>Pen activePen = new Pen(Color.Coral, 4);</big>
//
try 
{
bShowValue = true;
cmplxValA.X = (float)Convert.ToDouble(this.textComplexAReal.Text);
cmplxValA.Y = (float)Convert.ToDouble(this.textComplexAComplex.Text);
DrawComplexNumberA(g,activePen, cmplxValA.X, cmplxValA.Y);
} 
catch 
{ 
MessageBox.Show("Invalid Complex A Number", "Error!");
}
}

and do the similar thing in the other button but what you did here that you didn't initialized activePen you instead create new one which will not be visible outside complexA_OK_Click So to initialize activePen not create new one replace
<big>Pen </big>activePen = new Pen(Color.Coral, 4);

in complexA_OK_Click and complexB_OK_Click
With this one
activePen=new Pen(Color.Coral, 4);

Note that i remove the forward Pen Decleration

MCAD

-- modified at 18:10 Sunday 11th September, 2005
GeneralRe: Unhandled Ex..Param Null: Value pen??? Pin
Anonymous11-Sep-05 12:17
Anonymous11-Sep-05 12:17 
GeneralRe: Unhandled Ex..Param Null: Value pen??? Pin
Mohamad Al Husseiny11-Sep-05 12:19
Mohamad Al Husseiny11-Sep-05 12:19 
Questionproblem in DLL calling Pin
Jassim Rahma11-Sep-05 10:01
Jassim Rahma11-Sep-05 10:01 
QuestionRe: problem in DLL calling Pin
Guffa11-Sep-05 10:43
Guffa11-Sep-05 10:43 
QuestionDevelopment of setup and deployment projects(MSI files)! Pin
lata07mahi11-Sep-05 9:55
lata07mahi11-Sep-05 9:55 
AnswerRe: Development of setup and deployment projects(MSI files)! Pin
Mohamad Al Husseiny11-Sep-05 10:06
Mohamad Al Husseiny11-Sep-05 10:06 
QuestionConst vars Pin
Niklas Ulvinge11-Sep-05 9:26
Niklas Ulvinge11-Sep-05 9:26 
AnswerRe: Const vars Pin
Guffa11-Sep-05 9:41
Guffa11-Sep-05 9:41 
GeneralRe: Const vars Pin
Niklas Ulvinge11-Sep-05 21:43
Niklas Ulvinge11-Sep-05 21:43 
AnswerRe: Const vars Pin
S. Senthil Kumar12-Sep-05 0:24
S. Senthil Kumar12-Sep-05 0:24 
GeneralRe: Const vars Pin
Niklas Ulvinge12-Sep-05 3:42
Niklas Ulvinge12-Sep-05 3:42 
Question(CTRL + SHIFT) keyboard action Pin
Mike Jeferson11-Sep-05 8:33
Mike Jeferson11-Sep-05 8:33 
AnswerRe: (CTRL + SHIFT) keyboard action Pin
Mohamad Al Husseiny11-Sep-05 8:43
Mohamad Al Husseiny11-Sep-05 8:43 
GeneralRe: (CTRL + SHIFT) keyboard action Pin
Mike Jeferson11-Sep-05 11:36
Mike Jeferson11-Sep-05 11:36 
AnswerRe: (CTRL + SHIFT) keyboard action Pin
Mohamad Al Husseiny11-Sep-05 12:06
Mohamad Al Husseiny11-Sep-05 12:06 
GeneralRe: (CTRL + SHIFT) keyboard action Pin
Anonymous12-Sep-05 0:22
Anonymous12-Sep-05 0:22 
AnswerRe: (CTRL + SHIFT) keyboard action Pin
Mohamad Al Husseiny12-Sep-05 9:32
Mohamad Al Husseiny12-Sep-05 9:32 

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.