xsharp.eu • Encountered some problems when creating myTextBox by inheriting TextBox
Page 1 of 1

Encountered some problems when creating myTextBox by inheriting TextBox

Posted: Sat Oct 12, 2024 2:47 am
by xinjie
Hi,

I want to create a myTextBox because a TextBox cannot shift the mouse focus by typing Enter.
I wrote down the following code after going through some C# related material:

Code: Select all

Using System
Using System.Collections.Generic
Using System.ComponentModel
Using System.Linq
Using System.Text

Using System.Drawing
Using System.Windows.Forms

Begin Namespace myBaseClass
    /// <summary>
    /// The myTextBox class.
    /// </summary>
    Define Class myTextBox As TextBox
        Procedure OnKeyDown(KeyEventArgs e)
        Endproc
    Enddefine
End Namespace
I'm getting two errors when I build a class library project as a DLL that contains only this one class:
XS1003 Syntax error, 'END NAMESPACE' expected
XS9002 Parser: unexpected input 'e'

I need help.

Re: Encountered some problems when creating myTextBox by inheriting TextBox

Posted: Sat Oct 12, 2024 5:57 am
by wriedmann
Hi Xinjie,
the C# code

Code: Select all

Procedure OnKeyDown(KeyEventArgs e)
in X# has to be written as

Code: Select all

Procedure OnKeyDown(e as KeyEventArgs)
Wolfgang

Re: Encountered some problems when creating myTextBox by inheriting TextBox

Posted: Sat Oct 12, 2024 11:42 am
by xinjie
Hi, Wolfgang
Thank you!