StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
SubClass SF Button
SubClass SF Button
Post Reply
Like
1
Prev
1
2
Jump To Page
SubClass SF Button
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Greg McGuffey
Greg McGuffey
posted 15 Years Ago
ANSWER
Post Details
Share Post
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
Tags
Control Sub-Classing
VB.NET
Winforms
Reply
Like
2
Terry Bottorff
Terry Bottorff
posted 15 Years Ago
ANSWER
HOT
Topic Details
Share Topic
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.
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
1
Prev
1
2
Jump To Page
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search