MultiRowなどグリッドコントロールのセルにバルーンチップを表示する方法
対象製品
PlusPak for Windows Forms 7.0J
詳細
GcBalloonTipのShow(Control, Rectangle, TipPosition, BalloonTipInformation)メソッドを使用して、MultiRowなどのグリッドコンポーネントのセルにバルーンチップを表示することが可能です。この方法は、SPREAD、DataGridViewなどでも適用できます。
以下のサンプルコードは、現在のセルを離れるときにバルーンチップを表示する方法を示しています。
注意事項
以下のサンプルコードは、現在のセルを離れるときにバルーンチップを表示する方法を示しています。
[VB]
Imports GrapeCity.Win.Components
Private Sub GcMultiRow1_CellValidating(ByVal sender As System.Object, ByVal e As GrapeCity.Win.MultiRow.CellValidatingEventArgs) Handles GcMultiRow1.CellValidating
If e.FormattedValue = Nothing Then
Dim bound As Rectangle = GcMultiRow1.GetCellDisplayRectangle(e.RowIndex, e.CellIndex)
Dim balloon As New BalloonTipInformation
balloon.Text = "入力を確認してください。"
GcBalloonTip1.Show(GcMultiRow1, bound, TipPosition.BottomCenter, balloon)
End If
End Sub
Imports GrapeCity.Win.Components
Private Sub GcMultiRow1_CellValidating(ByVal sender As System.Object, ByVal e As GrapeCity.Win.MultiRow.CellValidatingEventArgs) Handles GcMultiRow1.CellValidating
If e.FormattedValue = Nothing Then
Dim bound As Rectangle = GcMultiRow1.GetCellDisplayRectangle(e.RowIndex, e.CellIndex)
Dim balloon As New BalloonTipInformation
balloon.Text = "入力を確認してください。"
GcBalloonTip1.Show(GcMultiRow1, bound, TipPosition.BottomCenter, balloon)
End If
End Sub
[C#]
using GrapeCity.Win.Components;
private void gcMultiRow1_CellValidating(object sender, GrapeCity.Win.MultiRow.CellValidatingEventArgs e)
{
if (e.FormattedValue == null)
{
Rectangle bound = gcMultiRow1.GetCellDisplayRectangle(e.RowIndex, e.CellIndex);
BalloonTipInformation balloon = new BalloonTipInformation();
balloon.Text = "入力を確認してください。";
gcBalloonTip1.Show(gcMultiRow1, bound, TipPosition.BottomCenter, balloon);
}
}
using GrapeCity.Win.Components;
private void gcMultiRow1_CellValidating(object sender, GrapeCity.Win.MultiRow.CellValidatingEventArgs e)
{
if (e.FormattedValue == null)
{
Rectangle bound = gcMultiRow1.GetCellDisplayRectangle(e.RowIndex, e.CellIndex);
BalloonTipInformation balloon = new BalloonTipInformation();
balloon.Text = "入力を確認してください。";
gcBalloonTip1.Show(gcMultiRow1, bound, TipPosition.BottomCenter, balloon);
}
}
注意事項
- グリッドでスクロールが発生したとき、表示位置がずれる場合があります。