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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:41:11+00:00 2026-06-17T08:41:11+00:00

I derived a component from System.Windows.Forms.ScrollableControl and I have problems to add border property.

  • 0

I derived a component from System.Windows.Forms.ScrollableControl and I have problems to add border property. I tried with CreateParams but without success, maybe I miss something?

Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
    Get
        Dim params As CreateParams = MyBase.CreateParams
        params.Style = params.Style Or &H800000 ' Turn on WS_BORDER
        Return params
    End Get
End Property

 'disable scroll bars, this part also disables my border
Protected Overrides Sub DefWndProc(ByRef m As Message)
    If m.Msg <> 131 Then
        MyBase.DefWndProc(m)
    End If
End Sub
  • 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-06-17T08:41:11+00:00Added an answer on June 17, 2026 at 8:41 am

    Looks like you want to have a border property of true/false:

    Protected Overrides ReadOnly Property CreateParams() As CreateParams
      Get
        Dim params As CreateParams = MyBase.CreateParams
        If _Border Then
          params.Style = params.Style Or &H800000 ' Turn on WS_BORDER
        End If
        Return params
      End Get
    End Property
    
    Private _Border As Boolean = False
    
    Property Border() As Boolean
      Get
        Return _Border
      End Get
      Set(ByVal value As Boolean)
        _Border = value
        Me.RecreateHandle()
        Me.Invalidate()
      End Set
    End Property
    

    Bob Powell has an article regarding that: Adding a standard border to a control

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

Sidebar

Related Questions

I have a windows forms project. It has a main form derived from System::Windows::Forms::Form
I have a control (derived from System.Windows.Forms.Control) which needs to be transparent in some
I have derived my own component from TAdoQuery in Delphi. I have overridden the
I have a component derived from ErrorProvider . I have a BaseForm and BaseUserControl
If i have a component derived from ItemsControl , can I access a collection
I have created a component derived from TCustomPanel. On that panel I have a
I am developing custom component derived from TCustomControl class. I would like to add
I have written a new custom component derived from TLabel. The component adds some
I have a class Derived that inherits directly from two base classes, Base1 and
I have a class derived from CTreeCtrl . In OnCreate() I replace the default

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.