RadButton - How to disable input focus???

6 posts, 0 answers
  1. Matjaz
    Matjaz avatar
    4 posts
    Member since:
    Feb 2009

    Posted 23 Feb 2009 Link to this post

    Hi,

    I'm facing simple but painful problem with RadButton control for WinForms. I want to prevent button to receive input focus! In my case I have one textbox and button which is used to clear contents of textbox. After click on button textbox must stay focused. Setting "CanFocus" property to false doesn't help! Button allways get input focus. Why? Is there any shortcut? I'm doing something wrong?

    Regards,
    Matjaz
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 23 Feb 2009 Link to this post

    Hi Matjaz,

    Thank you for using our support system. Just call the Focus() method of your text box at the end of the your button click event handler. I hope this is what you are looking for. Please write back if you need further assistance.

    Regards,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Matjaz
    Matjaz avatar
    4 posts
    Member since:
    Feb 2009

    Posted 23 Feb 2009 Link to this post

    Hi,

    Sorry, but you've missed the problem. I just want to disable input focus on the Button control with set "CanFocus" property value to false. Click on button set focus to the button and I don't want that. That's all. How to disable focus on the button???

    Regards,
    Matjaz
  5. Matjaz
    Matjaz avatar
    4 posts
    Member since:
    Feb 2009

    Posted 26 Feb 2009 Link to this post

    Hi,

    is anybody there???
  6. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Feb 2009 Link to this post

    Hi Matjaz,

    Thank you for writing. Please excuse me for the delay in the response.

    The CanFocus property is readonly, you can not assign a value to it. There is no way to make the RadButton or even the standard WinForms Button un-focusable. You can set their TabStop properties to false and that is pretty much all you can do. As I wrote previously you can just set the focus to the text box manually.

    Actually there is a way but it is not worth the effort for something as simple as this. You can inherit RadButton and override the WndProc method. In it you can ignore all messages that deal with the button focus. Please search the MSDN for articles or threads on how to do that.

    Please write again if you have other questions. There is a 72 hour response time for forum posts although we may respond faster.

    Regards,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Matjaz
    Matjaz avatar
    4 posts
    Member since:
    Feb 2009

    Posted 26 Feb 2009 Link to this post

    Thank you for your answer!

    Regards,
    Matjaz
Back to Top
UI for WinForms is Visual Studio 2017 Ready