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 6592801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:36:05+00:00 2026-05-25T17:36:05+00:00

I have written a Visual Studio 2008 addin that adds controls to a Form.

  • 0

I have written a Visual Studio 2008 addin that adds controls to a Form. I want some of those controls’ Visible property set to False so they’re hidden during runtime, so I do this:

If hiddenControls.Contains(.ColumnName) Then 'hiddenControls is TypeOf List(Of String)
    fieldControlAsControl.Visible = False 'TypeOf Control
End If

This doesn’t work. Not only is the control invisible in the designer window itself, but the .Visible = False code doesn’t even make it into [FormName].designer.vb.

I have tried forcing Serialization on the Visible property like so, to no avail:

<DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _
Public Shadows Property Visible() As Boolean
    Get
        Return MyBase.Visible
    End Get
    Set(ByVal value As Boolean)
        MyBase.Visible = value
    End Set
End Property

Can anyone help me with forcing the Visible property to be serialized in my addin?

  • 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-25T17:36:06+00:00Added an answer on May 25, 2026 at 5:36 pm

    I found a relatively good workaround (‘good’ meaning it doesn’t feel very ineloquent). I added the following code to the controls that get added to the form by my addin:

    <System.ComponentModel.Browsable(False)> _
    Public Overloads Property Visible() As Boolean
        Get
            Return MyBase.Visible
        End Get
        Set(ByVal value As Boolean)
            MyBase.Visible = value
        End Set
    End Property
    
    <System.ComponentModel.Category("Appearance")> _
    <System.ComponentModel.Description("Whether the FieldControl will be visible at runtime.")> _
    <System.ComponentModel.DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)> _
    <System.ComponentModel.Browsable(True)> _
    Public Property VisibleAtRunTime() As Boolean
        Get
            Return mVisibleAtRunTime
        End Get
        Set(ByVal value As Boolean)
            mVisibleAtRunTime = value
            If Not DesignMode Then
                Visible = value
            End If
        End Set
    End Property
    

    I then have the addin set the “VisibleAtRunTime” property instead of the “Visible” property.

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

Sidebar

Related Questions

JI have written a .NET C# Windows Form app in Visual Studio 2008 that
I have a program written in VB.Net (Visual Studio 2008) that uses a DLL
I have application written in Visual Studio 2008 which I deploy with ClickOnce to
I have written a very simple control. C# Visual Studio 2008. Its output should
I have visual studio 2008. I have a written a small C program. I
Visual Studio C++ 2008 / GCC 4.4.2 I have written a program to run
Let's say that you have a product that is written in Visual Studio and
I have a simple Windows App written in Visual Studio 2008 (.NET 3.0, C#).
I have a C# console application written using Visual Studio 2008. My system culture
Visual Studio 2008 .Net 3.5 C# I have a web site that has a

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.