Product: PowerShell Studio 2020 (64 Bit)
Build: v5.7.175
OS: Windows 10 Enterprise (64 Bit)
Build: v10.0.17134.0
The Tooltip control properties BackColor and ForeColor have no affect on the GUI tooltips.
Tooltip back and fore color won't set
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Tooltip back and fore color won't set
The tooltip control requires that the coloring be handled manually in the control's Draw event. For this event to be triggered, the property OwnerDraw must be set to true and IsBallon must be set to false.
Here is an example of the Draw event setting the ForeColor and BackColor:
Here is an example of the Draw event setting the ForeColor and BackColor:
- $tooltip1_Draw=[System.Windows.Forms.DrawToolTipEventHandler]{
- #Event Argument: $_ = [System.Windows.Forms.DrawToolTipEventArgs]
- $font = New-Object System.Drawing.Font("Segoe UI", 9.75)
- $tooltip1.BackColor = [System.Drawing.Color]::Black
- $_.DrawBackground()
- $_.Graphics.DrawString($_.ToolTipText, $font, [System.Drawing.Brushes]::GreenYellow, $_.Bounds.X, $_.Bounds.Y)
- }
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.