I’m writing a simple calc-based app in C# WinForms. My issue is that I have textbox to display results which cannot be clicked/focused because buttons are binded to keyboard. Textbox has to have ContextMenuStrip, but only this action should be handled within textbox. Also this app requirement is that it cannot have any focusable controls. Something like Windows’ Calc result box. Any advice?
Share
Create custom text box:
That’s all. Text box will never receive a focus (actually it will receive focus, but it will not change its look). Also consider suppress WM_CHAR message (0x102) if you want to disable user input.
UPDATE (trick you can use with buttons):