Use Control Inherits From StrataFrame Library


Author
Message
Wang Tong Yin
Wang Tong Yin
StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)
Group: Forum Members
Posts: 25, Visits: 46
Can I use my own control, which inherits from StrataFrame library? For example, I define a class called 'Textbox' as below:

Public Class Textbox

     Inherits MicroFour.StrataFrame.UI.Web.TextBox

     .

     .

     .

End Class

 

Will it cause any errors when i try to add, update or delete record?


Replies
Wang Tong Yin
Wang Tong Yin
StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)StrataFrame Novice (61 reputation)
Group: Forum Members
Posts: 25, Visits: 46
In foxpro we can use DODEFAULT() function to execute parent event or method. This can prevent child class from overwriting the codes in parent class. How to do this in VB.Net?
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
When you override a method, you have to call MyBase.MethodName().  So, if you're overriding the OnPaint() method of a control, it would look like this:

Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
    '-- Make the base method call (DODEFAULT())
    MyBase.OnPaint(e)

    '-- Custom code here
End Sub

Now, if you attach to an event, then there is no base or DODEFAULT that you need to call; it will be done automatically.  In fact, there is no way to prevent the base methods from firing.  Only on method overrides do you need to call the base method.


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