Latest News

  • Super Tower Defense 2 Game
    Sep 03, 2010

    New to the games section is Super Tower Defense 2. Featuring more maps, new units and bigger explosions.

  • Super Cards Online Multiplayer Game
    Aug 13, 2010

    Released today in the games section is the new Super Cards multiplayer card game. The aim of the game is to get rid of all your playing cards before your opposition.

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

edhalsim
edhalsim
Dialog popup and validation Posted: Oct 19, 2009
 

Hi,

I really like the way the popup dialog works (ShowAsModal), but I have a couple of questions:

1.  How does the Custom button work?  Having it in the list of buttons doesn't seem to do anything and I don't see a CustomContent property.

2.  I need to do some form validation in my dialog user control when the user presses "OK" and if there are errors show them and leave the dialog open.  Is that possible?

3.  Can you control the order of the buttons displayed?


Thanks!

 - Ed.

 
 
dan
dan
RE: Dialog popup and validation Posted: Oct 22, 2009
 

Hi Ed,


Specifying custom buttons is a bit limited at the moment and must be done in code, something like this:


myDialog.CreateButton(DialogButtons.Custom, "My Button", "myButton", true);


The 4th parameter determines whether the button is inserted before or after the existing buttons.


Regarding validation, you can stop the dialog from closing in the Closed event by setting e.Cancel = true:


private void myDialog_Closed(object sender, DialogEventArgs e)

{

    switch (e.Tag.ToString())

    {

        case "myButton":

            // Custom button clicked, do some validation

            if (Validate())

            {

                e.Cancel = true;

            }

            break;

    }

}


Thanks!

 
 
beaudetious
beaudetious
RE: Dialog popup and validation Posted: Mar 22, 2010
 

Exactly what I was looking for.  Thanks!

 
 
beaudetious
beaudetious
RE: Dialog popup and validation Posted: Mar 22, 2010
 

"Regarding validation, you can stop the dialog from closing in the Closed event by setting e.Cancel = true:"


That's what I meant to say was exactly what I was looking for.  This forum needs the ability to edit a post.  Can't you create an awesome Silverlight control for that?


Thanks,


Beaudetious

 
 
dan
dan
RE: Dialog popup and validation Posted: Mar 28, 2010
 

Hi Beaudetious,


Thanks for the info.  With regards to editing forum posts at the moment that is not possible, however we hope to get editing functionality implemented.


Thanks!

 
 

Rate this page: 

1 Star 2 Star 3 Star 4 Star 5 Star
12 Ratings / 3.3 Average