C1SlideTile コントロールと C1FlipTile コントロールは、コンテンツを自動的に一定の間隔で交互に表示します。この間隔は、静的 C1TileService クラスと UpdateInterval プロパティを使用して調整できます。次に例を示します。
Visual Basic コードの書き方
| Visual Basic |
コードのコピー
|
|---|---|
C1TileService.UpdateInterval = TimeSpan.FromSeconds(20) |
|
C# コードの書き方
| C# |
コードのコピー
|
|---|---|
C1TileService.UpdateInterval = TimeSpan.FromSeconds(20); |
|
更新間隔の値を大きくすると、更新の頻度が低くなります。
プログラムで、各タイルの UpdateTile メソッドを呼び出して、タイルを更新することもできます。たとえば、クリックされたときにタイルを更新するには、次のコードを使用します。
Visual Basic コードの書き方
| Visual Basic |
コードのコピー
|
|---|---|
Private Sub C1Tile_Click(sender As Object, e As System.EventArgs)
Dim tile As C1Tile = TryCast(sender, C1Tile)
If tile IsNot Nothing Then
tile.UpdateTile()
End If
End Sub
|
|
C# コードの書き方
| C# |
コードのコピー
|
|---|---|
private void C1Tile_Click(object sender, System.EventArgs e)
{
C1Tile tile = sender as C1Tile;
if(tile != null)
tile.UpdateTile();
}
|
|