Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: Searching for a string value Pin
Guffa6-Oct-05 1:20
Guffa6-Oct-05 1:20 
QuestionSetup starts after installation again Pin
Ariadne5-Oct-05 20:31
Ariadne5-Oct-05 20:31 
AnswerRe: Setup starts after installation again (minor bug) Pin
Ariadne6-Oct-05 20:14
Ariadne6-Oct-05 20:14 
QuestionSockets in C# Pin
Thoughthopper5-Oct-05 20:04
Thoughthopper5-Oct-05 20:04 
Questionsetup problem Pin
shashank veerkar5-Oct-05 19:40
shashank veerkar5-Oct-05 19:40 
AnswerRe: setup problem Pin
Ariadne5-Oct-05 20:49
Ariadne5-Oct-05 20:49 
QuestionHow to find all fax machines on asystem Pin
shashank veerkar5-Oct-05 18:48
shashank veerkar5-Oct-05 18:48 
QuestionHow to get an array of Pens in a user defined class to "work" in a WinForm? Pin
Anonymous5-Oct-05 16:39
Anonymous5-Oct-05 16:39 
Why won't the Form see this method?
///////////////////////////////////////////
//Here's a snippet of my Complex2.cs code (seperate Sol'n file)

private Pen [] activePen;
private int _penIndex = -1;

public Complex2()
{
Pen[] activePen = new Pen[] { new Pen( Color.Blue, 2 ), new Pen( Color.Green, 2 ), new Pen(Color.Red, 2) };
activePen[0].StartCap = System.Drawing.Drawing2D.LineCap.Triangle;
// TODO: Add constructor logic here
real = 0;
imag = 0;
}

public Complex2(double _re, double _im)
{
real = _re;
imag = _im;
}

public Pen GetNextPen()
{
_penIndex = (_penIndex + 1) % 3;
activePen[_penIndex].StartCap = System.Drawing.Drawing2D.LineCap.Triangle;
return activePen[_penIndex];
}

//////////////////////////////////////////////
//Here's some relevant code form Form1.cs

protected Complex2 cmplxValue1 = new Complex2(0,0); //these get values changed from TestBoxes...
protected Complex2 cmplxValue2 = new Complex2(0,0);

void DrawComplexNumber1(Graphics g)
{
Pen p = GetNextPen();
c_xy.SetOrigin(xIndent + graphRect.Width/2, yIndent + graphRect.Y/2);
cmplxValue1.Real = Convert.ToDouble(textComplex_1Real.Text);
cmplxValue1.Imaginary = Convert.ToDouble(textComplex_1Imaginary.Text);
g.DrawLine(GetNextPen(), 250, 250, (float)(250 + (xIndent * cmplxValue1.Real)), (float)(250 - (yIndent * cmplxValue1.Imaginary)));
}
ERROR
CForm1.cs(335): The name 'GetNextPen' does not exist in the class or namespace 'ComplexTest2.Form1'

Even if I try this:
g.DrawLine(cmplxValue1.GetNextPen()....) the instantiated object doesn't "see" the method... please help thanks a lot....


AnswerRe: How to get an array of Pens in a user defined class to "work" in a WinForm? Pin
Mohamad Al Husseiny5-Oct-05 18:59
Mohamad Al Husseiny5-Oct-05 18:59 
Questiondesinger for winforms? Pin
microsoc5-Oct-05 16:36
microsoc5-Oct-05 16:36 
AnswerRe: desinger for winforms? Pin
David Stone5-Oct-05 20:20
sitebuilderDavid Stone5-Oct-05 20:20 
QuestionWhy BinaryReader don't have the EOF property Pin
ediazc5-Oct-05 16:04
ediazc5-Oct-05 16:04 
AnswerRe: Why BinaryReader don't have the EOF property Pin
Guffa5-Oct-05 19:23
Guffa5-Oct-05 19:23 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:14
ediazc6-Oct-05 5:14 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Guffa6-Oct-05 6:12
Guffa6-Oct-05 6:12 
AnswerRe: Why BinaryReader don't have the EOF property Pin
S. Senthil Kumar5-Oct-05 19:42
S. Senthil Kumar5-Oct-05 19:42 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Guffa5-Oct-05 19:50
Guffa5-Oct-05 19:50 
GeneralRe: Why BinaryReader don't have the EOF property Pin
S. Senthil Kumar5-Oct-05 20:38
S. Senthil Kumar5-Oct-05 20:38 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:04
ediazc6-Oct-05 5:04 
GeneralRe: Why BinaryReader don't have the EOF property Pin
ediazc6-Oct-05 5:01
ediazc6-Oct-05 5:01 
GeneralRe: Why BinaryReader don't have the EOF property Pin
Moshe B16-Apr-10 5:18
Moshe B16-Apr-10 5:18 
QuestionWebClient and HTTPWebRequest dealing with redireciton? Pin
Red_Wizard_Shot_The_Food5-Oct-05 15:00
Red_Wizard_Shot_The_Food5-Oct-05 15:00 
AnswerRe: WebClient and HTTPWebRequest dealing with redireciton? Pin
Red_Wizard_Shot_The_Food5-Oct-05 16:05
Red_Wizard_Shot_The_Food5-Oct-05 16:05 
Questionnewbee ques on structs Pin
ter815-Oct-05 14:12
susster815-Oct-05 14:12 
AnswerRe: newbee ques on structs Pin
enjoycrack5-Oct-05 14:19
enjoycrack5-Oct-05 14:19 

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.