2008-10-20 79 views

回答

1

我還沒有嘗試過這個自己,但我想給它一個鏡頭:

System.Windows.Forms.ToolTip formToolTip = new System.Windows.Forms.ToolTip(); 
formToolTip .SetToolTip(item, "Row Tooltip"); 

item對應於細胞您可設置針對刀尖。

0
row.cells[indexof].ToolTipText= "tootip here". 

在winforms中,它看起來不像你可以做整行。

如果您需要整行可以循環通過單元格。

foreach (DataGridViewCell cell in row.Cells) 
       { 
        cell.ToolTipText = "tooltip here"; 
       } 
0
If TypeOf control Is TabControl Then 
    For Each control1 In control.Controls 
     If TypeOf control1 Is TabPage Then 
      strControlText = fnGetLanguage(control1.Text) 
     End If 
     For Each control2 In control1.Controls 
      If TypeOf control2 Is label Then 
       strControlText = control2.Text 
       ' strToolTipText = ToolTip.GetToolTip(control2) 
       If strControlText.Contains("*") Then 
        strDizi = Split(strControlText, " ") 
        strControlText = fnGetLanguage(strDizi(0)) 
       Else 
        strControlText = fnGetLanguage(control2.Text) 
       End If 
      ElseIf TypeOf control2 Is DataGridView Then 
       For i = 0 To control2.ColumnCount - 1 
        strControlText = control2.Columns(i).HeaderText 
        strControlText = fnGetLanguage(strControlText) 
       Next 
      ElseIf TypeOf control2 Is ComboBox Then 
       strControlText = control2.Text 
       'strToolTipText = ToolTip.GetToolTip(control2) 
       If control2.DataSource Is Nothing Then 
        For i = 0 To control2.Items.Count - 1 
         strControlText = control2.Items(i) 
         strControlText = fnGetLanguage(strControlText) 
        Next 
       Else 
        For i = 0 To control2.Items.Count - 1 
         strControlText = control2.Items(i).ToString 
         strControlText = fnGetLanguage(strControlText) 
        Next 
       End If 
      End If 
     Next 
    Next 
End If 
相關問題