Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can make FullScreen and Top Form? Pin
Richard MacCutchan24-Sep-09 7:04
mveRichard MacCutchan24-Sep-09 7:04 
AnswerRe: How can make FullScreen and Top Form? Pin
PIEBALDconsult24-Sep-09 8:41
mvePIEBALDconsult24-Sep-09 8:41 
Questionownerdraw MenuStrip Adobe Cs4 lookalike, any voluntairs? Pin
Natural_Demon24-Sep-09 5:27
Natural_Demon24-Sep-09 5:27 
QuestionHow to exclude a property from data binding? Pin
Frank W. Wu24-Sep-09 5:23
Frank W. Wu24-Sep-09 5:23 
AnswerRe: How to exclude a property from data binding? Pin
Ennis Ray Lynch, Jr.24-Sep-09 7:32
Ennis Ray Lynch, Jr.24-Sep-09 7:32 
QuestionCollection within collection classes (a la Treeview/TreeNodes) Pin
Nyoshu24-Sep-09 4:10
Nyoshu24-Sep-09 4:10 
AnswerRe: Collection within collection classes (a la Treeview/TreeNodes) Pin
Not Active24-Sep-09 4:49
mentorNot Active24-Sep-09 4:49 
QuestionAs Keyword, conversion of derived class to base class type Pin
Raybarg24-Sep-09 3:26
professionalRaybarg24-Sep-09 3:26 
Here is example code I made for this question:
using System;
namespace TestingAs
{
    class baseClass
    {
        public string foo
        {
            get;
            set;
        }
    }
    class derivedClass : baseClass
    {
        public string bar
        {
            get;
            set;
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            derivedClass derived = new derivedClass();
            baseClass b = derived as baseClass;
            Console.WriteLine("type is {0}", b.GetType());
            Console.ReadLine();
        }
    }
}


I also tried just casting baseclass b = (baseClass)derived; which gives the same result:
type is TestingAs.derivedClass

Why b is not type of baseClass? How would I "convert" my derived class into base class type?

Thank you in advance!
AnswerRe: As Keyword, conversion of derived class to base class type Pin
Abhishek Sur24-Sep-09 3:29
professionalAbhishek Sur24-Sep-09 3:29 
AnswerRe: As Keyword, conversion of derived class to base class type Pin
PIEBALDconsult24-Sep-09 5:16
mvePIEBALDconsult24-Sep-09 5:16 
GeneralRe: As Keyword, conversion of derived class to base class type Pin
Raybarg29-Sep-09 21:48
professionalRaybarg29-Sep-09 21:48 
GeneralRe: As Keyword, conversion of derived class to base class type Pin
PIEBALDconsult30-Sep-09 3:51
mvePIEBALDconsult30-Sep-09 3:51 
AnswerRe: As Keyword, conversion of derived class to base class type Pin
OriginalGriff24-Sep-09 6:15
mveOriginalGriff24-Sep-09 6:15 
QuestionHow to add Xml Node in Microsoft Word doucment by using C# (VSTO) Pin
Shaik Haneef24-Sep-09 3:07
Shaik Haneef24-Sep-09 3:07 
QuestionDateTime difference Pin
Matt Cavanagh24-Sep-09 2:31
Matt Cavanagh24-Sep-09 2:31 
AnswerRe: DateTime difference Pin
OriginalGriff24-Sep-09 2:36
mveOriginalGriff24-Sep-09 2:36 
GeneralRe: DateTime difference Pin
Matt Cavanagh24-Sep-09 4:14
Matt Cavanagh24-Sep-09 4:14 
AnswerRe: DateTime difference Pin
Not Active24-Sep-09 2:37
mentorNot Active24-Sep-09 2:37 
GeneralRe: DateTime difference Pin
Matt Cavanagh24-Sep-09 4:17
Matt Cavanagh24-Sep-09 4:17 
AnswerRe: DateTime difference Pin
Luc Pattyn24-Sep-09 2:45
sitebuilderLuc Pattyn24-Sep-09 2:45 
GeneralRe: DateTime difference Pin
Matt Cavanagh24-Sep-09 4:17
Matt Cavanagh24-Sep-09 4:17 
QuestionTiff Image Processing Pin
Lalit singh24-Sep-09 1:51
Lalit singh24-Sep-09 1:51 
AnswerRe: Tiff Image Processing Pin
stancrm24-Sep-09 2:17
stancrm24-Sep-09 2:17 
Questioncomment utiliser le MultiColumnComb de Janus WinForms Controls? Pin
asma0724-Sep-09 1:22
asma0724-Sep-09 1:22 
AnswerRe: comment utiliser le MultiColumnComb de Janus WinForms Controls? Pin
Keith Barrow24-Sep-09 1:52
professionalKeith Barrow24-Sep-09 1:52 

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.