Click here to Skip to main content
15,886,810 members
Home / Discussions / C#
   

C#

 
GeneralRe: turn GUI program into service Pin
Colin Angus Mackay2-Feb-06 12:20
Colin Angus Mackay2-Feb-06 12:20 
GeneralRe: turn GUI program into service Pin
malharone2-Feb-06 12:11
malharone2-Feb-06 12:11 
GeneralRe: turn GUI program into service Pin
BlackDice2-Feb-06 12:16
BlackDice2-Feb-06 12:16 
AnswerRe: turn GUI program into service Pin
Colin Angus Mackay2-Feb-06 12:02
Colin Angus Mackay2-Feb-06 12:02 
AnswerRe: turn GUI program into service Pin
Andy Brummer2-Feb-06 12:19
sitebuilderAndy Brummer2-Feb-06 12:19 
AnswerRe: turn GUI program into service Pin
bskirkman2-Feb-06 17:53
bskirkman2-Feb-06 17:53 
GeneralRe: turn GUI program into service Pin
bskirkman2-Feb-06 17:55
bskirkman2-Feb-06 17:55 
QuestionC# Class Inheritance Pin
LighthouseJ2-Feb-06 11:16
LighthouseJ2-Feb-06 11:16 
I have 4 classes. Class A is derived from System.Object, class B is derived from ArrayList (the collection class), class C and class D are derived from class B. All 4 classes of mine have ToString methods that each show a different thing. I used the 'override' reserved word in each declaration to replace the funcionality of the inherited method. I have a form which has a drop-down listbox that utilizes the ToString methods of classes' C and D only. I also have a TreeView that shows all 4 classes in a tree diagram, consider that class B and D are root items in the tree view and only contain objects of type A and C respectively.

The problem is classes A and B work 100% fine, but only those two.

However, classes C and D are the problem. In the form with the list box, I add objects of type class C using dlg.listbox.Add(new class C("some text", somevalue)); before showing the form. Class C has that overridden ToString method that returns a special string based on that string and that value given to it. On runtime, the box simply says (Collection) instead of what it should.

Later, the same class C object shows up in the tree view, but instead of seeing the same (Collection), you see some text but only that text. Somewhere the object is returning that custom text element and not the value, and the ToString method for class C incorporates both like I mentioned earlier.

I don't know how to fix this. I put breakpoints on every ToString method and the first two classes trigger fine but C and D's are never used. The project is too complex to just paste it all so if you have an idea and need more info, just ask and I'll be glad to answer.
AnswerRe: C# Class Inheritance Pin
Guffa2-Feb-06 11:21
Guffa2-Feb-06 11:21 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:44
LighthouseJ2-Feb-06 11:44 
AnswerRe: C# Class Inheritance Pin
Guffa2-Feb-06 22:19
Guffa2-Feb-06 22:19 
GeneralRe: C# Class Inheritance Pin
LighthouseJ3-Feb-06 4:34
LighthouseJ3-Feb-06 4:34 
AnswerRe: C# Class Inheritance Pin
Ravi Bhavnani2-Feb-06 11:24
professionalRavi Bhavnani2-Feb-06 11:24 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:45
LighthouseJ2-Feb-06 11:45 
AnswerRe: C# Class Inheritance Pin
malharone2-Feb-06 11:37
malharone2-Feb-06 11:37 
GeneralRe: C# Class Inheritance Pin
LighthouseJ2-Feb-06 11:53
LighthouseJ2-Feb-06 11:53 
QuestionEDIT MENU + CUT, COPY, PASTE Pin
emran8342-Feb-06 11:08
emran8342-Feb-06 11:08 
AnswerRe: EDIT MENU + CUT, COPY, PASTE Pin
J4amieC2-Feb-06 23:08
J4amieC2-Feb-06 23:08 
GeneralRe: EDIT MENU + CUT, COPY, PASTE Pin
emran8343-Feb-06 17:20
emran8343-Feb-06 17:20 
QuestionGet a controll fully customized Pin
Sasuko2-Feb-06 10:22
Sasuko2-Feb-06 10:22 
AnswerRe: Get a controll fully customized Pin
Ingo3-Feb-06 2:14
Ingo3-Feb-06 2:14 
QuestionTo know which file was opened by an application. Pin
yjoo93172-Feb-06 10:13
yjoo93172-Feb-06 10:13 
AnswerRe: To know which file was opened by an application. Pin
malharone2-Feb-06 11:11
malharone2-Feb-06 11:11 
GeneralRe: To know which file was opened by an application. Pin
yjoo93172-Feb-06 11:26
yjoo93172-Feb-06 11:26 
GeneralRe: To know which file was opened by an application. Pin
Dave Kreskowiak2-Feb-06 15:40
mveDave Kreskowiak2-Feb-06 15:40 

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.