Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5952463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:41:08+00:00 2026-05-22T17:41:08+00:00

First, please look at this custom Button-inherited UserControl code: Public Class UserControl1 Dim _Text

  • 0

First, please look at this custom Button-inherited UserControl code:

Public Class UserControl1

Dim _Text As String
Dim _Image As Image

<Browsable(True), Description("Gets or sets the text displayed on the button")> _
Overrides Property Text() As String
    Get
        Return _Text
    End Get
    Set(ByVal value As String)
        _Text = value
        MyBase.Text = value
    End Set
End Property

<Browsable(True), Description("Gets or sets the image displayed on the button")> _
Overloads Property Image() As Image
    Get
        Return _Image
    End Get
    Set(ByVal value As Image)
        _Image = value
        'ReDrawMe()
    End Set
End Property

End Class

That’s ALL the code of the UserControl. The Overrides at Text property is OK, but I don’t know why VS tell me I CAN’T use Overrides at Image property, but I can use Overloads. Why? I thought Overloads only use if there’re multiple methods with the same name (different parameters). Two things I still doubt:

  1. Why Image is the only property declaration in this class, but it must be called Overloads?
  2. The Property doesn’t have any parameter (of course), so how could Overloads possible?

Thanks for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:41:09+00:00Added an answer on May 22, 2026 at 5:41 pm

    Because the Image property in the ButtonBase class isn’t declared as Overridable you cannot override it in derived classes.

    You can shadow the parent declaration (i.e. hide it) by redeclaring it in the deriving class as Shadows or Overloads. The difference between these two is rather small (§1.15.3 in the VB language specification):

    • Shadows shadows by name: if a method (or property) is declared Shadows then it shadows all base class methods (or properties) of the same name.

    • Overloads shadows by name and signature: it only hides a method of the same name and same signature.

    In your case, both result in the same because there is only a single property of that name.

    Either way, if the parent property isn’t marked as overridable, then redefining it in a derived class is a bad idea – it won’t work properly when your control is accessed via its base class type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day, could you please help me look and this code and tell me
This is my first question so please be patient :) Background: I'm implementing an
First of all please dont suggest me to do this using css. I need
I was involved in couple of cloud computing platform recently. First of all please
First question on here so please be nice :) I know very little about
First off, I understand the reasons why an interface or abstract class (in the
First off, there's a bit of background to this issue available on my blog:
First of all, sorry for the title. Someone please propose a better one, I
Please take a look at the following JavaScript. I've taken stuff out of it,
First, let's get the security considerations out of the way. I'm using simple authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.