We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

SplashPanel and control focus

Thread ID:

Created:

Updated:

Platform:

Replies:

46153 Jul 6,2006 04:50 PM Jul 10,2006 12:37 AM Windows Forms 4
loading
Tags: Tools
Jonathan Quail
Asked On July 6, 2006 04:50 PM

We used the SplashPanel to implement a custom Messagebox (similar to the standard windows MessageBox.Show ()) but with a custom look. The only problem I am having is the idea of setting a "default" button. That is, if you have a "Yes" and "No" button (say, button1 and button2 respectively) on the panel. And you want the "No" (button2) to be the default button. This behaivor exists in the MessageBox class by way of the DefaultButton enum. I set the focus on the buttons like this: case MessageBoxDefaultButton.Button1: default: button1.Focus (); break; case MessageBoxDefaultButton.Button2: button2.Focus (); break; case MessageBoxDefaultButton.Button3: button3.Focus (); break; Except this doesn''t work, neither does button2.Select (). All three buttons are ButtonAdv controls. I suspect it could be because the splash panel is not a form (MSDN Doc states: "the control must be a form or the control''s outermost parent must be a form." in refernce to the Control.CanFocus property which is always false) Is there any other way to set what control has focus when the panel is shown? Or any way to trick the buttons into thinking their parent control is a form not a panel? When i show the Splash panel, I use ShowDialogSplash (null) (passing in a valid Form object doesn''t seem to make a difference). Any suggestions would be greatly appreciated! Thanks, Jonathan

Anupama Roy [Syncfusion]
Replied On July 7, 2006 03:01 AM

Hi Jonathan, Inorder to set the focus to the desired button on a SplashPanel,I tried with this.buttonAdv1.Select (); and it works fine here.You can have a switch case as mentioned and can have multiple choice also between the buttons as you wish. Could you please take a look at the sample attached and let us know if you have any difficulties. Sample Thanks for choosing Syncfusion products. Regards, Anu.

Anupama Roy [Syncfusion]
Replied On July 7, 2006 07:51 AM

Hi Jonathan, If you have any difficulties,could you please mention the EssentialStudio version that you are working with. Thanks, Anu.

Jonathan Quail
Replied On July 7, 2006 03:23 PM

Perfect! That fixed the issue. I wonder if my problem initially was that I was trying to set the focus on the button before calling "ShowDialogSplash (null)". Even with button2.Select () it didn''t work until I placed that code into the BeforeSplash event handler - then it worked with no issues. Thanks again! > >Hi Jonathan, > >If you have any difficulties,could you please mention the EssentialStudio version that you are working with. > > >Thanks, > >Anu. >

Anupama Roy [Syncfusion]
Replied On July 10, 2006 12:37 AM

Hi Jonathan, Thanks for the update. Regards, Anu.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;