本文整理匯總了C#中System.Windows.Forms.PopupEventArgs類的典型用法代碼示例。如果您正苦於以下問題:C# PopupEventArgs類的具體用法?C# PopupEventArgs怎麽用?C# PopupEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PopupEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了PopupEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: NotesTip_Popup
private void NotesTip_Popup(object sender, PopupEventArgs e)
{
if (OwnerDraw)
{
// e.ToolTipSize = new Size(maxWidth + _padding.Horizontal, totalHeight);
}
}
示例2: toolTip_Popup
private static void toolTip_Popup(object sender, PopupEventArgs e)
{
Size sz = TextRenderer.MeasureText(((ToolTip)sender).GetToolTip(e.AssociatedControl), new Font(tooltipFontFace, tooltipFontSize));
sz.Height += 4;
sz.Width += 4;
e.ToolTipSize = sz;
}
示例3: OnUIAPopup
#pragma warning disable 169
private static void OnUIAPopup (object sender, PopupEventArgs args)
{
ToolTip tooltip = (ToolTip) sender;
ToolTipProvider provider
= (ToolTipProvider) ProviderFactory.GetProvider (tooltip);
provider.Show (args.AssociatedControl);
}
示例4: toolTip1_Popup
private void toolTip1_Popup(object sender, PopupEventArgs e)
{
toolTip1.SetToolTip(buttonDisplayLabelInfo, "Put into mailing label");
toolTip1.SetToolTip(buttonClear, "Clear shipping information");
toolTip1.SetToolTip(buttonPrint, "Print this program");
toolTip1.SetToolTip(buttonExit, "Exit program");
}
示例5: RichToolTip_Popup
//Fires before the draw event. So set the tooltip size here.
void RichToolTip_Popup(object sender, PopupEventArgs e)
{
using (Graphics g = RtbPCtrl.CreateGraphics())
{
toolTipSize = g.MeasureString(RtbPCtrl.Rtf.Trim(), RtbPCtrl.Font).ToSize();
e.ToolTipSize = toolTipSize;
}
}
示例6: OnPopup
private void OnPopup(object sender, PopupEventArgs e)
{
var text = this.GetToolTip(e.AssociatedControl);
var fontsize = e.AssociatedControl.FindForm().Font.Size;
var font = new Font(SystemFonts.DefaultFont.FontFamily, fontsize);
e.ToolTipSize = TextRenderer.MeasureText(text, font);
e.ToolTipSize = new Size(e.ToolTipSize.Width + TOOLTIP_XOFFSET, e.ToolTipSize.Height + TOOLTIP_YOFFSET);
font.Dispose();
}
示例7: MobToolTip_Popup
private void MobToolTip_Popup( object sender, PopupEventArgs e ) {
Size s;
using( Font f = new Font( "Tahoma", 9 ) )
using( Image img = new Bitmap( e.ToolTipSize.Width, e.ToolTipSize.Height ) )
using( Graphics g = Graphics.FromImage( img ) )
s = DrawMobInfo( g, f, false );
e.ToolTipSize = new Size( s.Width + 4, s.Height + 4 );
}
示例8: ColorToolTip_Popup
public void ColorToolTip_Popup( object sender, PopupEventArgs e ) {
SizeF s;
// fake a Draw to get final Size
using( Image img = new Bitmap( e.ToolTipSize.Width, e.ToolTipSize.Height ) ) {
using( Graphics g = Graphics.FromImage( img ) ) {
s = DrawTooltip( g, mDrawFont, false );
}
}
e.ToolTipSize = new Size( (int)s.Width + 4, (int)s.Height + 4 );
}
示例9: ColorToolTip_Popup
private void ColorToolTip_Popup(object sender, PopupEventArgs e) {
// fake a Draw to get final Size
SizeF finalSize;
using (Image img = new Bitmap(e.ToolTipSize.Width, e.ToolTipSize.Height)) {
using (Graphics g = Graphics.FromImage(img)) {
finalSize = DrawTooltip(g, true);
}
}
e.ToolTipSize = new Size((int)finalSize.Width + TooltipPadding.Right, (int)finalSize.Height + TooltipPadding.Bottom);
}
示例10: m_toolTip_Popup
/// <summary>
/// Handles popup event from ToolTip control.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void m_toolTip_Popup(object sender, PopupEventArgs e)
{
// If height of tooltip differs from the previous one, then we
// must store it and do not show tooltip at wrong position
if (!m_size.Equals(e.ToolTipSize))
{
m_size = e.ToolTipSize;
e.Cancel = true;
m_canceled = true;
m_text = String.Empty;
return;
}
m_canceled = false;
}
示例11: HtmlToolTip_Popup
void HtmlToolTip_Popup(object sender, PopupEventArgs e)
{
string text = this.GetToolTip(e.AssociatedControl);
string font = string.Format(NumberFormatInfo.InvariantInfo, "font: {0}pt {1}", e.AssociatedControl.Font.Size, e.AssociatedControl.Font.FontFamily.Name);
//Create fragment container
container = new InitialContainer("<table class=htmltooltipbackground cellspacing=5 cellpadding=0 style=\"" + font + "\"><tr><td style=border:0px>" + text + "</td></tr></table>");
container.SetBounds(new Rectangle(0, 0, 10, 10));
container.AvoidGeometryAntialias = true;
//Measure bounds of the container
using (Graphics g = e.AssociatedControl.CreateGraphics())
{
container.MeasureBounds(g);
}
//Set the size of the tooltip
e.ToolTipSize = Size.Round(container.MaximumSize);
}
示例12: filterTip_Popup
/// <summary>
/// Wywoływana, gdy pojawia się podpowiedź zawierająca tekst filtra. Dostosowywuje rozmiar podpowiedzi.
/// </summary>
/// <param name="sender">Podpowiedź wyświetlająca tekst filtra.</param>
/// <param name="e">Argumenty zdarzenia.</param>
void filterTip_Popup(object sender, PopupEventArgs e)
{
e.ToolTipSize = comboBox.Size;
}
示例13: variableHover_Popup
private void variableHover_Popup(object sender, PopupEventArgs e)
{
using (Font fw = new Font(FontFamily.GenericMonospace, ToolTipFontSize))
{
SizeF size = TextRenderer.MeasureText(m_HoverText, fw);
e.ToolTipSize = new Size((int)size.Width, (int)size.Height);
}
}
示例14: ToolTip_Popup
private void ToolTip_Popup(object sender, PopupEventArgs e) {
using (Graphics g = Graphics.FromHwnd(Handle)) {
int width = (int) Math.Ceiling(g.MeasureString(_cell.Description, _font).Width) + 1;
e.ToolTipSize = new Size(Math.Max(width, _cell.Width), RowHeight);
}
}
示例15: HandlePopup
/// ------------------------------------------------------------------------------------
/// <summary>
/// Handles the popup.
/// </summary>
/// ------------------------------------------------------------------------------------
void HandlePopup(object sender, PopupEventArgs e)
{
using (Graphics g = Graphics.FromHwnd(e.AssociatedWindow.Handle))
{
Size sz1 = TextRenderer.MeasureText(g, ToolTipTitle, m_fntTitle);
Size sz2 = TextRenderer.MeasureText(g, m_text, m_fntText);
m_rcTitle = new Rectangle(10, 10, sz1.Width, sz1.Height);
m_rcText = new Rectangle(10, m_rcTitle.Bottom + 15, sz2.Width, sz2.Height);
if (m_showMissingGlyphIcon)
{
m_rcTitle.X += (m_missingGlyphIcon.Width + 5);
sz1.Width += (m_missingGlyphIcon.Width + 5);
sz1.Height = Math.Max(sz1.Height, m_missingGlyphIcon.Height);
}
sz1.Width = Math.Max(sz1.Width, sz2.Width) + 20;
sz1.Height += (sz2.Height + 35);
e.ToolTipSize = sz1;
}
}