[Gambas-user] Disable right click popup menu of textbox

T Lee Davidson t.lee.davidson at gmail.com
Thu Oct 1 06:18:55 CEST 2020

On 9/30/20 5:27 PM, Gianluigi wrote:
> Il giorno mer 30 set 2020 alle ore 19:32 T Lee Davidson <t.lee.davidson at gmail.com <mailto:t.lee.davidson at gmail.com>> ha scritto:
>     On 9/30/20 1:29 PM, T Lee Davidson wrote:
>      > I have attached a modified project in which:
> Hi Lee,
> in your solution:
> $hText = New TextBox($hContenedor) As Me.Name
> instead of
> $hText = New TextBox($hContenedor) As "CajaTexto"
> there is something that does not convince me, how do you raise the Change event?
> Regards
> Gianluigi

Good point, Gianluigi.

The inherited class, UserControl, does not implement a Change event.

I was merely trying to quickly solve the issue of the appropriate event handler being called. Now that I've taken a closer look 
at it, it appears that the event name of the TextBox does not need to be unique. Simply making the name of the popup menu unique 
is sufficient.

To make a Change event work:
1) Leave the line that creates the TextBox as: $hText = New TextBox($hContenedor) As "CajaTexto"
2) In the clastextbox class header, add: Event Change()
3) Implement an event handler in the class for the CajaTexto_Change() event:
Public Sub CajaTexto_Change()
   Raise Change()

This allows the parent form to handle the change event of each distinct clastextbox object.


More information about the User mailing list