FlexGrid for WinForms Task-Based Help > Adding ToolTips That Display UserData > UserData ToolTips for a Row |
To add ToolTips that display UserData for a row, use C1FlexGrid's MouseMove event to get the UserData property and display it in a ToolTip control.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1FlexGrid1.Rows(8).UserData = "Oxygen makes up approximately 1/5 of the earth's atmosphere." |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1FlexGrid1.Rows[8].UserData = "Oxygen makes up approximately 1/5 of the earth's atmosphere."; |
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub C1FlexGrid1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1FlexGrid1.MouseMove Dim tip As String tip = C1FlexGrid1.Rows(C1FlexGrid1.MouseRow).UserData ToolTip1.SetToolTip(C1FlexGrid1, tip) End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void c1FlexGrid1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { string tip; tip = (string)c1FlexGrid1.Rows[c1FlexGrid1.MouseRow].UserData; toolTip1.SetToolTip(c1FlexGrid1, tip); } |
The ToolTip appears across the entire row.