C# | |
---|---|
using DevExpress.Utils; // The component used to load images from a form's resources. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); // The image to display within a SuperTooltip. Image resImage = ((System.Drawing.Image)(resources.GetObject("resource.Image1"))); // Method 1 SuperToolTip sTooltip1 = new SuperToolTip(); // Create a tooltip item that represents a header. ToolTipTitleItem titleItem1 = new ToolTipTitleItem(); titleItem1.Text = "Edit Popup Menu"; // Create a tooltip item that represents the SuperTooltip's contents. ToolTipItem item1 = new ToolTipItem(); item1.Image = resImage; item1.Text = "Show the Edit popup menu"; // Add the tooltip items to the SuperTooltip. sTooltip1.Items.Add(titleItem1); sTooltip1.Items.Add(item1); // Method 2 SuperToolTip sTooltip2 = new SuperToolTip(); // Create an object to initialize the SuperToolTip. SuperToolTipSetupArgs args = new SuperToolTipSetupArgs(); args.Title.Text = "Edit Popup Menu"; args.Contents.Text = "Show the Edit popup menu"; args.Contents.Image = resImage; sTooltip2.Setup(args); |
在代码中创建 SuperToolTips
最新推荐文章于 2024-11-27 11:48:19 发布