This is a migrated thread and some comments may be shown as answers.

Focus on Button

9 Answers 604 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 16 Jul 2007, 04:38 AM
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

9 Answers, 1 is accepted

Sort by
0
Cristi71000
Top achievements
Rank 1
answered on 18 Jul 2007, 01:59 PM
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.
0
Dimitar Kapitanov
Telerik team
answered on 19 Jul 2007, 01:28 PM
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
0
Erik
Top achievements
Rank 1
answered on 26 Jul 2007, 04:24 AM
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
0
Dimitar Kapitanov
Telerik team
answered on 27 Jul 2007, 03:14 PM
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
0
Erik
Top achievements
Rank 1
answered on 31 Jul 2007, 10:37 AM
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
0
Dimitar Kapitanov
Telerik team
answered on 01 Aug 2007, 03:19 PM
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
0
Erik
Top achievements
Rank 1
answered on 03 Aug 2007, 09:04 AM
Yes, This solved the problem
Thanks so much
0
Erik
Top achievements
Rank 1
answered on 22 Aug 2007, 09:26 AM
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
0
Mike
Telerik team
answered on 23 Aug 2007, 04:01 PM
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
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Erik
Top achievements
Rank 1
Answers by
Cristi71000
Top achievements
Rank 1
Dimitar Kapitanov
Telerik team
Erik
Top achievements
Rank 1
Mike
Telerik team
Share this question
or