Click here to Skip to main content
15,921,622 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Select item from datagridviewcomboboxcell Pin
Dalek Dave13-Jun-11 11:41
professionalDalek Dave13-Jun-11 11:41 
GeneralRe: Select item from datagridviewcomboboxcell Pin
phil.o13-Jun-11 11:46
professionalphil.o13-Jun-11 11:46 
Questioncopy file in vb.net Pin
faravani8-Jun-11 23:06
faravani8-Jun-11 23:06 
AnswerRe: copy file in vb.net PinPopular
Eddy Vluggen9-Jun-11 0:59
professionalEddy Vluggen9-Jun-11 0:59 
GeneralRe: copy file in vb.net Pin
Wayne Gaylard9-Jun-11 1:33
professionalWayne Gaylard9-Jun-11 1:33 
GeneralRe: copy file in vb.net Pin
Smithers-Jones9-Jun-11 3:31
Smithers-Jones9-Jun-11 3:31 
GeneralRe: copy file in vb.net Pin
Eddy Vluggen9-Jun-11 4:54
professionalEddy Vluggen9-Jun-11 4:54 
QuestionReflection: Get Subclass Type [modified] Pin
KenBonny8-Jun-11 3:12
KenBonny8-Jun-11 3:12 
I have a situation with inheritance. In my base class I have a function GetName() which I want to supply the name of the class that calls the function. But how do I give the name of my current subclass and not the base class? This is my code so far.

Class Base 
  Public Function GetName() As String
    ' Bad code
    'Return System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name.ToLower()

    ' Good code
    Dim type as Type = Me.GetType()
    Return type.Name
  End Function
End Class

Class Sub
 Inherits Base

  ' Some unrelated code
End Class

' In program somewhere
  Dim s as Sub
  Console.PrintLine(s.GetName()) ' should print out Sub, but it prints Base


EDIT: I found the solution. about 30 minutes after this post, I found it. Frown | :( Adjusted the code.

modified on Wednesday, June 8, 2011 9:43 AM

AnswerRe: Reflection: Get Subclass Type Pin
Eddy Vluggen8-Jun-11 3:33
professionalEddy Vluggen8-Jun-11 3:33 
GeneralRe: Reflection: Get Subclass Type Pin
KenBonny8-Jun-11 3:59
KenBonny8-Jun-11 3:59 
AnswerRe: Reflection: Get Subclass Type Pin
Luc Pattyn8-Jun-11 3:45
sitebuilderLuc Pattyn8-Jun-11 3:45 
GeneralRe: Reflection: Get Subclass Type Pin
KenBonny8-Jun-11 4:00
KenBonny8-Jun-11 4:00 
QuestionVB Deployment - Automatically run an exe file Pin
Central_IT7-Jun-11 5:00
Central_IT7-Jun-11 5:00 
AnswerRe: VB Deployment - Automatically run an exe file Pin
Dave Kreskowiak7-Jun-11 8:06
mveDave Kreskowiak7-Jun-11 8:06 
AnswerRe: VB Deployment - Automatically run an exe file Pin
thatraja7-Jun-11 9:53
professionalthatraja7-Jun-11 9:53 
QuestionEmail Program [modified] Pin
Uma Kameswari7-Jun-11 2:05
Uma Kameswari7-Jun-11 2:05 
GeneralRe: Email Program Pin
thatraja7-Jun-11 2:27
professionalthatraja7-Jun-11 2:27 
GeneralRe: Email Program Pin
Uma Kameswari7-Jun-11 2:35
Uma Kameswari7-Jun-11 2:35 
GeneralRe: Email Program Pin
Richard MacCutchan7-Jun-11 3:13
mveRichard MacCutchan7-Jun-11 3:13 
GeneralRe: Email Program Pin
Uma Kameswari7-Jun-11 3:20
Uma Kameswari7-Jun-11 3:20 
GeneralRe: Email Program Pin
Richard MacCutchan7-Jun-11 3:30
mveRichard MacCutchan7-Jun-11 3:30 
GeneralRe: Email Program Pin
Uma Kameswari7-Jun-11 3:38
Uma Kameswari7-Jun-11 3:38 
GeneralRe: Email Program Pin
Richard MacCutchan7-Jun-11 5:03
mveRichard MacCutchan7-Jun-11 5:03 
GeneralRe: Email Program Pin
Johan Hakkesteegt13-Jun-11 22:37
Johan Hakkesteegt13-Jun-11 22:37 
GeneralRe: Email Program Pin
Uma Kameswari13-Jun-11 22:53
Uma Kameswari13-Jun-11 22:53 

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.