Focus on Button

10 posts, 0 answers
  1. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 15 Jul 2007 Link to this post

    Hi,

    I try to set the focus on the textbox by radtexbox.focus. But it's seem that the cursor is not on that radtexbox. In MS radtexbox, if we set the focus on the radtexbox, the cursor will be on that radtexbox.

    Please help

    Thanks
  2. Cristi71000
    Cristi71000 avatar
    25 posts
    Member since:
    Apr 2007

    Posted 18 Jul 2007 Link to this post

    I had the same problem. If you are using a base class to call the Focus method on, it won't show the cursor. Try casting to RadTextBox before and it should work.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 19 Jul 2007 Link to this post

    Hi Cristi71000,
    The last post states correctly. We use shadowing Focus method in RadTextBox (because Focus method is impossible to override). This means that if you you cast RadTextBox to a base class (say to Control) you execute the base Focus method, which do things improperly in regard to TPF.

    Sincerely yours,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 25 Jul 2007 Link to this post

    how to focus on button? Please help. I got lots of textbox and try to set the tab index to button and accept return key.

    Thanks
  6. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 27 Jul 2007 Link to this post

    Hello eriksurya,
    Please explain in details what are you trying to accomplish. If possible send us a small sample case to test locally.

    Best wishes,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 31 Jul 2007 Link to this post

    in vb.net using the default button (built in .net), when the focus is in that button we can see the focus, the graphic is different.
    How to do it using this telerik button?

    Thanks
  8. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 01 Aug 2007 Link to this post

    Hi eriksurya,
    You have to set the AllowShowFocusCues of RadButton to true and you will get the "focused rectangle" behavior. Please tell us whether this solved the problem.

    All the best,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 03 Aug 2007 Link to this post

    Yes, This solved the problem
    Thanks so much
  10. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 22 Aug 2007 Link to this post

    Hi,
    I found another problem with this focused rectangle on button. In  form_load , I set button1. focus. I expected that the button will show focused rectangle behaviour. But, it DIDNT. What is going on?

    But if u try to TAB to next button, it showed to that next button. Please help.

    Thanks so much
  11. Mike
    Admin
    Mike avatar
    640 posts

    Posted 23 Aug 2007 Link to this post

    Hi eriksurya,

    This behavior is by design in a Windows Forms application. Here is link which explains this issue in detail: http://blogs.msdn.com/oldnewthing/archive/2005/05/03/414317.aspx

    We have found a simple way (not so clean, though) to change this logic. Please find attached a demo app that demonstrates this approach.

    Another solution would be to change the buttons' theme to one like "Vista" or "WinXpLuna", which supports alternative focus cues (such as colored inner rectangle) and does not depend on system's UI state.

     
    Sincerely yours,
    Mike
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for WinForms is Visual Studio 2017 Ready