Well, as far as I know, the TextBox control has the following methods:
Copy(), Cut(), Paste(), and Undo(). This way you have the essential
functionality done immediately. You can also change the text flow
direction using RightToLeft property. As for the Unicode specialities,
I am not sure, but I believe that would have to be done manually.
Best regards,
nvx
> In VS2005 I would like to add an entry to the default context menu for
> a textbox control, but don't see any way to get access to the default
[quoted text clipped - 7 lines]
> And finally, the default context menu for a ReadOnly textbox has the
> Paste item enabled. Is that a bug?
Jack Jackson - 26 Jan 2008 16:36 GMT
But my question was how can I add my own items to the default menu? I
can't find any way to get a reference to the default menu.
>Well, as far as I know, the TextBox control has the following methods:
>Copy(), Cut(), Paste(), and Undo(). This way you have the essential
[quoted text clipped - 16 lines]
>> And finally, the default context menu for a ReadOnly textbox has the
>> Paste item enabled. Is that a bug?
nvx - 26 Jan 2008 19:00 GMT
Yes, that's right, but your second question was "If I create my own
context menu, is there any way to get the
functionality of the default context menu items without writing a lot
of code? ..." :)
Since I do not know of any way of modifying the default context menu
(I do not say there is none...), I answered the second question to
ensure you that the essential functionality of the default context
menu can be maintained without writing a lot of code. There may be a
way to modify the default menu, but if you need just copy, paste, cut,
undo, and select all, it is really easier to go via your own context
menu.
Best regards,
nvx
> But my question was how can I add my own items to the default menu? I
> can't find any way to get a reference to the default menu.
[quoted text clipped - 19 lines]
> >> And finally, the default context menu for a ReadOnly textbox has the
> >> Paste item enabled. Is that a bug?
Jack Jackson - 26 Jan 2008 21:59 GMT
Sorry, I misunderstood your answer. Thanks, that helps a lot.
>Yes, that's right, but your second question was "If I create my own
>context menu, is there any way to get the
[quoted text clipped - 35 lines]
>> >> And finally, the default context menu for a ReadOnly textbox has the
>> >> Paste item enabled. Is that a bug?
nvx - 27 Jan 2008 09:35 GMT
Don't worry, I might have quoted the second question. Everything would
have been clear then. There's no need to apologize. :)
Best regards,
nvx
> Sorry, I misunderstood your answer. Thanks, that helps a lot.
>
[quoted text clipped - 37 lines]
> >> >> And finally, the default context menu for a ReadOnly textbox has the
> >> >> Paste item enabled. Is that a bug?
Claes Bergefall - 28 Jan 2008 12:15 GMT
In addition, to duplicate the Delete command you'll have to use P/Invoke and
the WM_CLEAR message. There's no builtin .NET method for it.
/claes
> Well, as far as I know, the TextBox control has the following methods:
> Copy(), Cut(), Paste(), and Undo(). This way you have the essential
[quoted text clipped - 16 lines]
>> And finally, the default context menu for a ReadOnly textbox has the
>> Paste item enabled. Is that a bug?
Jack Jackson - 28 Jan 2008 19:20 GMT
For a Textbox, can't you just set .Text = ""?
>In addition, to duplicate the Delete command you'll have to use P/Invoke and
>the WM_CLEAR message. There's no builtin .NET method for it.
[quoted text clipped - 21 lines]
>>> And finally, the default context menu for a ReadOnly textbox has the
>>> Paste item enabled. Is that a bug?
Claes Bergefall - 29 Jan 2008 11:24 GMT
Simply setting the Text property does not enable the undo feature. WM_CLEAR
does.
/claes
> For a Textbox, can't you just set .Text = ""?
>
[quoted text clipped - 24 lines]
>>>> And finally, the default context menu for a ReadOnly textbox has the
>>>> Paste item enabled. Is that a bug?
Jack Jackson - 29 Jan 2008 15:12 GMT
Thanks
>Simply setting the Text property does not enable the undo feature. WM_CLEAR
>does.
[quoted text clipped - 29 lines]
>>>>> And finally, the default context menu for a ReadOnly textbox has the
>>>>> Paste item enabled. Is that a bug?