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

  • SEARCH
  • Home
  • 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 6543077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:18:12+00:00 2026-05-25T11:18:12+00:00

I am making a custom button control and am having some difficulty with my

  • 0

I am making a custom button control and am having some difficulty with my Text property. Anything I type in only stays while the form designer window is open. When I close the form designer and reopen it, my Text property resets to “”. Also if I run the program, it loses the value entered at design time.

I also have an Image property for my control which is working just fine.

Here’s some of my code:

Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Windows.Forms
Imports System.ComponentModel

Public Class BlackButton

Private iText As String
Private iImage As Image

''' <summary>
''' Gets/Sets the text displayed in the button.
''' </summary>
<Browsable(True), Description("Gets or sets the text displayed on the button")> _
Public Shadows Property Text() As String
    Get
        Return iText
    End Get
    Set(ByVal value As String)
        iText = value
        ReDrawMe()
    End Set
End Property

''' <summary>
''' Gets/Sets the image to be displayed on the button
''' </summary>
<Browsable(True), Description("Gets or sets the image displayed on the button")> _
Public Shadows Property Image() As Image
    Get
        Return iImage
    End Get
    Set(ByVal value As Image)
        iImage = value
        ReDrawMe()
    End Set
End Property

I have carefully combed through my code and made sure I’m not resetting it anywhere.

Thanks in advance for any help on this.

  • 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-25T11:18:12+00:00Added an answer on May 25, 2026 at 11:18 am

    It seems to work adding a property :

    <Browsable(True), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _
    Public Overrides Property Text() As String
        Get
            Return MyBase.Text
        End Get
        Set(ByVal value As String)
            MyBase.Text = value
            LabInfo.Text = MyBase.Text
        End Set
    End Property
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a custom control I need to add some default keybindings, microsoft
We can make WPF Custom Control for overriding some control's look&feel, like icon button.
Im making a custom button called ShardButton which uses a Style to control its
I am making a custom ImageButton Control which has the option to show button
I am making a custom form object in Django which has an overrided __init__
I'm making a custom control that can be dragged around and it is semi
I am making an application that does some custom image processing. The program will
I'm making a custom control that's an expandable/collapsable panel, which I can then fill
I have been making my own custom control and I ran into trouble when
So basically im making a custom button. Desired Behaviour: When a user mouses over,

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.