Click here to Skip to main content
15,918,050 members
Home / Discussions / C#
   

C#

 
AnswerRe: checking LAN connectivity Pin
mav.northwind24-Sep-05 20:38
mav.northwind24-Sep-05 20:38 
GeneralRe: checking LAN connectivity Pin
g00fyman24-Sep-05 20:48
g00fyman24-Sep-05 20:48 
GeneralRe: checking LAN connectivity Pin
g00fyman24-Sep-05 21:33
g00fyman24-Sep-05 21:33 
GeneralRe: checking LAN connectivity Pin
mav.northwind25-Sep-05 19:58
mav.northwind25-Sep-05 19:58 
GeneralRe: checking LAN connectivity Pin
g00fyman25-Sep-05 21:17
g00fyman25-Sep-05 21:17 
QuestionCheck Box Pin
Anonymous24-Sep-05 16:17
Anonymous24-Sep-05 16:17 
AnswerRe: Check Box Pin
miah alom25-Sep-05 7:11
miah alom25-Sep-05 7:11 
QuestionProblem in Code : SEE COMMENT** Pin
Anonymous24-Sep-05 16:13
Anonymous24-Sep-05 16:13 
If someone could take a look at this code and see what I'm doing wrong I'd appreciate it. If I place the code that converts the TextBox values to cmplxValue1's //SEE COMMENT**1,**2, in the try block I get a
line from the (0,0) in the ClientRect, to the center of the ClientRect.
If I try to convert in the button click I get an unhandled exception.
//////////////////////////////////////////////////////////////////////////
** Exception Text **************
System.FormatException: Input string was not in a correct format.
at System.Number.ParseDouble(String s, NumberStyles style, NumberFormatInfo info)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Convert.ToDouble(String value)
at ComplexTest2.Form1.DrawComplexNumber(Graphics g, Complex2 cmplxValue1) in c:\documents and settings\xyz\my documents\software engineering\c#_projects\c#_ tempfiles\complextest2\form1.cs:line 340
//////////////////////////////////////////////////////////////////////////

//code on Form1 linked to Complex2 class-> yes I hav Set/Get properties for all...
//Member fields.

public Pen[] activePen = new Pen[] { new Pen( Color.Blue ), new Pen( Color.Green ), new Pen(Color.Red) };
Complex2 c_xy = new Complex2(250, 250); //OK
protected Complex2 cmplxValue1 = new Complex2(0,0); //OK
protected Complex2 cmplxValue2 = new Complex2(0,0); //OK




private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
//Graphics g = this.CreateGraphics();
//Pen [] cmplxPen = new Pen []{new Pen(Color.Red, 2), new Pen(Color.Green, 2), new Pen(Color.Blue, 2)};
DrawGraphRectF(e.Graphics);//WORKS
DrawXYAxes(e.Graphics);//WORKS
DrawGraphXandYTicks(e.Graphics);WORKS
if(cmplxValue1.DrawLine1)//bool flag
//MessageBox.Show(Convert.ToString(xIndent + graphRect.Width/2)); //OK as Test for Runtime Values = 250, 250
DrawComplexNumber(e.Graphics, cmplxValue1);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private void complex_1OK_Click(object sender, System.EventArgs e)
{
//
try
{
/*bool flag*/cmplxValue1.DrawLine1 = true;
this.Invalidate();
}
catch
{
MessageBox.Show("Invalid Complex A Number", "Error!");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void DrawComplexNumber(Graphics g, Complex2 cmplxValue1)
{
this.cmplxValue1.Real = Convert.ToDouble(this.textComplex_1Real.Text); //SEE COMMENT ABOVE** 1
this.cmplxValue1.Imaginary = Convert.ToDouble(this.textComplex_1Imaginary.Text); //SEE COMMENT ABOVE **2
g.DrawLine(activePen[0], (float)c_xy.Real, (float)c_xy.Imaginary, (float)cmplxValue1.Real, (float)cmplxValue1.Imaginary);
}

AnswerRe: Problem in Code : SEE COMMENT** Pin
Guffa24-Sep-05 22:00
Guffa24-Sep-05 22:00 
QuestionControl Array Pin
StephenMcAllister24-Sep-05 10:49
StephenMcAllister24-Sep-05 10:49 
AnswerRe: Control Array Pin
Daniel Grunwald24-Sep-05 21:34
Daniel Grunwald24-Sep-05 21:34 
GeneralRe: Control Array Pin
StephenMcAllister24-Sep-05 21:57
StephenMcAllister24-Sep-05 21:57 
Questionxml node problem Pin
thepersonof24-Sep-05 8:48
thepersonof24-Sep-05 8:48 
AnswerRe: xml node problem Pin
Guffa24-Sep-05 12:27
Guffa24-Sep-05 12:27 
QuestionApplication Domains Pin
Tomas Brennan24-Sep-05 4:41
Tomas Brennan24-Sep-05 4:41 
AnswerRe: Application Domains Pin
Nick Parker24-Sep-05 9:05
protectorNick Parker24-Sep-05 9:05 
GeneralRe: Application Domains Pin
Tomas Brennan25-Sep-05 5:38
Tomas Brennan25-Sep-05 5:38 
GeneralRe: Application Domains Pin
Tomas Brennan29-Sep-05 3:13
Tomas Brennan29-Sep-05 3:13 
QuestionBig StructLayout question Pin
Alex Cutovoi24-Sep-05 4:14
Alex Cutovoi24-Sep-05 4:14 
AnswerRe: Big StructLayout question Pin
Guffa24-Sep-05 8:44
Guffa24-Sep-05 8:44 
QuestionC# articles Pin
CWinThread24-Sep-05 4:12
CWinThread24-Sep-05 4:12 
AnswerRe: C# articles Pin
Alex Cutovoi24-Sep-05 4:21
Alex Cutovoi24-Sep-05 4:21 
GeneralRe: C# articles Pin
CWinThread24-Sep-05 13:18
CWinThread24-Sep-05 13:18 
QuestionWhich is efficient? "" or string.Empty ? Pin
manivannan.p24-Sep-05 2:59
manivannan.p24-Sep-05 2:59 
AnswerRe: Which is efficient? "" or string.Empty ? Pin
mav.northwind24-Sep-05 3:17
mav.northwind24-Sep-05 3:17 

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.