Generate the infobulle with Silverlight

37 views Asked by At

I need to generate the infobulle for a button in Silverlight with C#. I have this code :

<Button x:Name="ctr" Content="Contrôler" Foreground="White" Margin="10 0" Click="ctr_Click"
    <ToolTipService.ToolTip>
    <ToolTip>
    <Grid>
    <TextBlock Text="Contrôler">
    </Grid>
    </ToolTip>
    </ToolTipService.ToolTip>
    </Button>

but I need the change the infobulle in C# like this

if (message =="OK") infobulle-->controle the page else infobulle-->controle
1

There are 1 answers

1
hajar On
if (message =="OK") {
 ToolTipService.SetToolTip(this.ctr, new TextBlock() { Text = "controle the page" });
}
else{
 ToolTipService.SetToolTip(this.ctr, new TextBlock() { Text = "controle" });
}