내 프로젝트에서 도구 설명 컨트롤을 사용하고 있습니다. 그 뒷 배경색을 설정하고 싶습니다. ownerdraw 속성을 true로, backcolor를 red로 변경했습니다. 그러나 결과는 없습니다. 어떠한 제안?winform 변경 도구 설명 배경색
감사합니다. skpaul.
내 프로젝트에서 도구 설명 컨트롤을 사용하고 있습니다. 그 뒷 배경색을 설정하고 싶습니다. ownerdraw 속성을 true로, backcolor를 red로 변경했습니다. 그러나 결과는 없습니다. 어떠한 제안?winform 변경 도구 설명 배경색
감사합니다. skpaul.
설정이 propeties :
이yourTooltip.OwnerDraw = true;
yourTooltip.BackColor = System.Drawing.Color.Red;
다음 그리기 이벤트에서이를 사용
여기 (당신의 취향에 적응) 신속하고 더러운 예입니다
private void yourTooltip_Draw(object sender, DrawToolTipEventArgs e)
{
e.DrawBackground();
e.DrawBorder();
e.DrawText();
}
컨트롤을 OwnerDraw로 설정하면 컨트롤 그리기를 직접 처리해야합니다.
Private Sub ToolTip1_Draw(sender As Object, e As DrawToolTipEventArgs) Handles ToolTip1.Draw
Dim tt As ToolTip = CType(sender, ToolTip)
Dim b As Brush = New SolidBrush(tt.BackColor)
e.Graphics.FillRectangle(b, e.Bounds)
Dim sf As StringFormat = New StringFormat
sf.Alignment = StringAlignment.Center
sf.LineAlignment = StringAlignment.Center
e.Graphics.DrawString(e.ToolTipText, SystemFonts.DefaultFont, SystemBrushes.ActiveCaptionText, e.Bounds, sf)
sf.Dispose()
b.Dispose()
End Sub
건배
true로하는 OwnerDraw를 ToolStrip에하고 설정하는 이벤트를 추가
public Form1() {
InitializeComponent();
toolTip1.OwnerDraw = true;
toolTip1.Draw += new DrawToolTipEventHandler(toolTip1_Draw);
}
그런 다음 그리기 이벤트 방법을 추가하려면 :
void toolTip1_Draw(object sender, DrawToolTipEventArgs e) {
Font f = new Font("Arial", 10.0f);
toolTip1.BackColor = System.Drawing.Color.Red;
e.DrawBackground();
e.DrawBorder();
e.Graphics.DrawString(e.ToolTipText, f, Brushes.Black, new PointF(2, 2));
}
간단하게 "대단하다"- 정확히 내가 원하는 것 ....... –
당신을 진심으로 환영합니다. –
다른 문제가 있습니다. 내가 여기 물어 봐도 될까요 ?? 그 약 .rdlc 보고서. –
도 존재들을 몰랐어요! –
내 투표는 100 %입니다. 간단한 코드, 기억하기 쉽고, 완벽하게 작동합니다. 감사합니다 Nacereddine, 많은 많은 많은 감사드립니다. –
@SKPaul 환영합니다. 해피 코딩 :) – Nasreddine