A Handy Tool: Working with C1PromptBox

Studio for Silverlight and WPF contain many small and helpful components that you might not be aware of. This blog post focuses on the C1PromptBox class that provides a quick prompt window to collect user data. It’s very easy to use. Just add a reference to the C1.Silverlight or C1.WPF libraries and write this one line of code.


C1PromptBox.Show("Message", "Caption", this.HandlePrompt);  

The third parameter is the call back event that fires when the user closes the window. In this event you can grab the input data and do what you wish.


private void HandlePrompt(string input, MessageBoxResult result)  
{  
    if (result == MessageBoxResult.OK)  
    {  
        // TODO  
    }  
}  

C1PromptBox is a simple component that can be very handy to have lying around. For simpler message boxes without input, try the C1MessageBox class. Both components are described in our Windows for Silverlight or Windows for WPF documentation.

Studio for Silverlight and WPF contain many small and helpful components that you might not be aware of. This blog post focuses on the C1PromptBox class that provides a quick prompt window to collect user data.

It’s very easy to use. Just add a reference to the C1.Silverlight or C1.WPF libraries and write this one line of code.Studio for Silverlight and WPF contain many small and helpful components that you might not be aware of. This blog post focuses on the C1PromptBox class that provides a quick prompt window to collect user data. It’s very easy to use. Just add a reference to the C1.Silverlight or C1.WPF libraries and write this one line of code.

Greg Lutz

comments powered by Disqus