Click here to Skip to main content
15,900,973 members
Home / Discussions / C#
   

C#

 
JokeRe: How can i do table like this one Pin
Jun Du12-Jun-06 8:46
Jun Du12-Jun-06 8:46 
QuestionForcing Validated event before Click event for a ToolStrip button Pin
Luis Alonso Ramos12-Jun-06 8:31
Luis Alonso Ramos12-Jun-06 8:31 
QuestionProgress Message Box? Pin
ahall@mirapoint.com12-Jun-06 7:33
ahall@mirapoint.com12-Jun-06 7:33 
AnswerRe: Progress Message Box? [modified] Pin
Ed.Poore12-Jun-06 9:08
Ed.Poore12-Jun-06 9:08 
GeneralRe: Progress Message Box? Pin
ahall@mirapoint.com12-Jun-06 11:33
ahall@mirapoint.com12-Jun-06 11:33 
QuestionPassing an instance of the base class to a child class Pin
MrEyes12-Jun-06 6:37
MrEyes12-Jun-06 6:37 
AnswerRe: Passing an instance of the base class to a child class Pin
Dustin Metzgar12-Jun-06 6:49
Dustin Metzgar12-Jun-06 6:49 
AnswerRe: Passing an instance of the base class to a child class Pin
Jun Du12-Jun-06 7:40
Jun Du12-Jun-06 7:40 
First of all, The object of the child class contains the portion of data from the base class. You can replace that portion with any object of the base class, but your MyChild code is not working the way you anticipated.

I think you are confused about how to handle class relationship. There are two approaches here:

1) inheritance ("Car is a Vehicle")
2) composition ("Car has an Engine")

MyChild class code looks more like composition relation, namely, it contains an object of MyBase. The code should be something like this:

class MyChild
{
  public MyChild(bool bl, MyBase baseData)
  {
    this.bl = bl;
    this.baseData = baseData;
  }

  private bool bl;
  private MyBase baseData; // here MyBase is just like a boolean type
}




- It's easier to make than to correct a mistake.
QuestionFixing flicker in a DataGridView? Pin
Andrew Stampor12-Jun-06 6:24
Andrew Stampor12-Jun-06 6:24 
GeneralRe: Fixing flicker in a DataGridView? Pin
Office Lineman12-Jun-06 9:22
Office Lineman12-Jun-06 9:22 
GeneralRe: Fixing flicker in a DataGridView? Pin
Andrew Stampor12-Jun-06 9:53
Andrew Stampor12-Jun-06 9:53 
GeneralRe: Fixing flicker in a DataGridView? Pin
Office Lineman12-Jun-06 10:04
Office Lineman12-Jun-06 10:04 
GeneralRe: Fixing flicker in a DataGridView? Pin
Andrew Stampor13-Jun-06 4:19
Andrew Stampor13-Jun-06 4:19 
GeneralRe: Fixing flicker in a DataGridView? Pin
Office Lineman13-Jun-06 7:09
Office Lineman13-Jun-06 7:09 
GeneralRe: Fixing flicker in a DataGridView? Pin
Andrew Stampor13-Jun-06 8:40
Andrew Stampor13-Jun-06 8:40 
GeneralRe: Fixing flicker in a DataGridView? Pin
Office Lineman13-Jun-06 9:34
Office Lineman13-Jun-06 9:34 
GeneralThe final piece of the puzzle... Pin
Andrew Stampor13-Jun-06 10:51
Andrew Stampor13-Jun-06 10:51 
GeneralRe: The final piece of the puzzle... Pin
Office Lineman13-Jun-06 11:21
Office Lineman13-Jun-06 11:21 
GeneralRe: Fixing flicker in a DataGridView? Pin
Nougat H.12-Jun-06 10:05
Nougat H.12-Jun-06 10:05 
QuestioncomboBox refresh Pin
andrei_dalcu12-Jun-06 5:33
andrei_dalcu12-Jun-06 5:33 
AnswerRe: comboBox refresh Pin
Paul Brower12-Jun-06 8:15
Paul Brower12-Jun-06 8:15 
GeneralRe: comboBox refresh Pin
andrei_dalcu12-Jun-06 8:26
andrei_dalcu12-Jun-06 8:26 
GeneralRe: comboBox refresh Pin
Mr. VB.NET12-Jun-06 18:20
Mr. VB.NET12-Jun-06 18:20 
QuestionOpen source diagram framework? [modified] Pin
Yuval Naveh12-Jun-06 5:14
Yuval Naveh12-Jun-06 5:14 
AnswerRe: Open source diagram framework? Pin
S. Senthil Kumar12-Jun-06 5:19
S. Senthil Kumar12-Jun-06 5: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.