SubClass SF Button


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Terry,

To override the size, I'd use the contstructor:

Public Sub New()
  '-- Call base constructor.
  MyBase.New()

  '-- Set default height/width.
  Me.Height = 32
  Me.Width = 75
End Sub


To set the click behavior, override the OnClick sub.

Protected Overrides Sub OnClick(e As EventArgs)
  '-- Add custom logic to happen before clicks are handled

  '-- Call base class (this raises the click event for consumers)
  MyBase.OnClick(e)

  '-- Add custom logic to happen after clicks are handled.
End Sub

Terry Bottorff
Terry Bottorff
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 448, Visits: 12K
It is time I increase my skill level. So I want to learn how to subclass some of the SF controls. I want to start with the SF Button. I have been able to subclass the button and have it show up in the toolbox. I can drag it to a form and it works like a normal SF button. But now I want to set it size, text and change the click event. I can not seem to find the correct syntax so I need a little nudge to get me going.  I think one thing I need to do is an click override but I can not seem to find a sample and not sure how to set the size and text. TIA.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search