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

Angel angelnunez123 at gmail.com
Wed Sep 30 21:14:04 CEST 2020


Thank you very much, with the modifications you have made works well.

I'd been stuck with that for several days.

I thought an object's code was as isolated from another object.

<Changing the iBackground value seems to have no effect. >
I haven't put all the code missing more code, the Background property is 
missing


El 30/9/20 a las 19:29, T Lee Davidson escribió:
> On 9/30/20 7:28 AM, Angel wrote:
>> Hi.
>> Your example does work for me, the one that doesn't work for me is my 
>> example, if I ting the popup menu with
>> $hText.PopupMenu ? "mnuTextbox"
>> event CajaTexto_MouseDown().
>> The first object that launches the menu receives all events, even if 
>> you are on another object.
>> If I ting the popup menu with a variable of type Menu,
>> If it works but once my popup menu is closed, the textbox menu is 
>> launched, the two menus come out.
>>
>> I don't know if I've explained myself well, my English is very bad.
>
> With the project you attached, I get only one popup menu; and it is 
> your custom menu.
>
> However, you are correct that the first TextBox created receives all 
> the events. That is because each one is given the same event name 
> (with: As "CajaTexto"), and each popup menu is also given the same 
> event name (with: As "mnuTextbox") making all the textboxes use the 
> first textbox's event handler and menu. The first one defined 
> obviously takes precedence.
>
> I have attached a modified project in which:
> 1) The popup menu definition has been moved to the _new subroutine 
> since it does not need to be defined per each event.
> 2) Each TextBox gets its event name from its name, ie. As Me.Name.
> 3) Each popup menu gets its event name from its TextBox name, ie. As 
> "mnu" & Me.Name.
>
> As long as the popup menu property of the TextBox is properly set, the 
> MouseDown event is not needed.
>
> And by the way, changing the value of iBackground appears to have no 
> effect.
>
>


More information about the User mailing list