내 앱에 툴팁을 추가했습니다.툴팁이 표시되지 않는 이유는 무엇입니까?
컨트롤 (DataGridView)에서 힌트/도구 설명을 표시하려는 위치에 "도구 설명"속성에 단어를 추가했습니다. 하지만 내 말씨는 표시되지 않습니다 (정확한 것은 없습니다).
왜?
관련 버튼에 언어를 추가했는데 제대로 작동합니다. 아마도 DGV 자체가 툴팁을 처리 할 수 없습니까? 여기에 추가
는
using System;
using System.Drawing;
using System.Windows.Forms;
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
var form = new Form {
Controls = {
new Button { Name = "button", Location = new Point(10, 10) },
new DataGridView { Name = "dgv", Location = new Point(10, 50) },
},
};
var tooltip = new ToolTip();
tooltip.SetToolTip(form.Controls["button"], "Button Tooltip");
tooltip.SetToolTip(form.Controls["dgv"], "DGV Tooltip");
Application.Run(form);
GC.KeepAlive(tooltip); // it's cheaper than implementing IContainer on the form for this demo
}
}
추가되는 방법에 대한 코드 샘플을 표시 할 수 있습니까? – MethodMan
이것은 매우 쉽게 복제 할 수 있습니다. DGV 및 도구 설명을 양식에 놓고 DGV의 확장 속성을 설정하는 것보다 여기에서 코드를 복사하여 붙여 넣는 것이 더 오래 걸립니다. 완벽하게 유효한 질문입니다. – Tergiver
코드 없음 - 방금 구성 요소를 놓고 DGV의 속성에 텍스트를 입력했습니다. –