Sales
1-888-9DOTNET
|
In order to set the BackColor and ForeColor, we need to assign the appropriate colors to the ToolTip through ToolTipInfo object. C# toolTipInfothroughCode2.BackColor = System.Drawing.Color.Cyan; toolTipInfothroughCode2.ForeColor = System.Drawing.Color.Chocolate; VB Private toolTipInfothroughCode2.BackColor = System.Drawing.Color.Cyan Private toolTipInfothroughCode2.ForeColor = System.Drawing.Color.Chocolate We can change the ForeColor and BackColor of the SuperToolTip through its properties which has depicted in the following code. C# private Syncfusion.Windows.Forms.Tools.SuperToolTip superToolTip2 = new Syncfusion.Windows.Forms.Tools.SuperToolTip(); private Syncfusion.Windows.Forms.Tools.ToolTipInfo toolTipInfothroughCode2 = new Syncfusion.Windows.Forms.Tools.ToolTipInfo(); private void Form1_Load(object sender, EventArgs e) { toolTipInfothroughCode2.BackColor = System.Drawing.Color.DarkOliveGreen; toolTipInfothroughCode2.ForeColor = System.Drawing.Color.Aquamarine; toolTipInfothroughCode2.Body.Text = " Please enter the text."; toolTipInfothroughCode2.Body.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.superToolTip2.SetToolTip(this.textBox2, toolTipInfothroughCode2); } private void buttonAdv1_Click(object sender, EventArgs e) { toolTipInfothroughCode2.ForeColor = System.Drawing.Color.DarkRed; toolTipInfothroughCode2.BackColor = System.Drawing.Color.CornflowerBlue; } VB Private superToolTip2 As Syncfusion.Windows.Forms.Tools.SuperToolTip = New Syncfusion.Windows.Forms.Tools.SuperToolTip() Private toolTipInfothroughCode2 As Syncfusion.Windows.Forms.Tools.ToolTipInfo = New Syncfusion.Windows.Forms.Tools.ToolTipInfo() Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) toolTipInfothroughCode2.BackColor = System.Drawing.Color.DarkOliveGreen toolTipInfothroughCode2.ForeColor = System.Drawing.Color.Aquamarine toolTipInfothroughCode2.Body.Text = " Please enter the text." toolTipInfothroughCode2.Body.Font = New System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CByte(0))) Me.superToolTip2.SetToolTip(Me.textBox2, toolTipInfothroughCode2) End Sub Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs) toolTipInfothroughCode2.ForeColor = System.Drawing.Color.DarkRed toolTipInfothroughCode2.BackColor = System.Drawing.Color.CornflowerBlue End Sub |