Check ComboBoxRenderer.IsSupported

This commit is contained in:
pointfeev 2024-07-22 01:50:17 -04:00
parent 9f1b47bcfd
commit 80b684e95b

View file

@ -126,7 +126,7 @@ internal sealed class CustomTreeView : TreeView
TextRenderer.DrawText(graphics, text, font, point, color, TextFormatFlags.Default); TextRenderer.DrawText(graphics, text, font, point, color, TextFormatFlags.Default);
} }
if (form is SelectForm) if (form is SelectForm && ComboBoxRenderer.IsSupported)
{ {
Selection selection = Selection.FromId(platform, id); Selection selection = Selection.FromId(platform, id);
if (selection is not null && selection.CanUseProxy) if (selection is not null && selection.CanUseProxy)
@ -209,7 +209,7 @@ internal sealed class CustomTreeView : TreeView
break; break;
} }
if (e.Button is not MouseButtons.Left) if (e.Button is not MouseButtons.Left || !ComboBoxRenderer.IsSupported)
return; return;
if (comboBoxBounds.Count > 0 && selectForm is not null) if (comboBoxBounds.Count > 0 && selectForm is not null)
foreach (KeyValuePair<Selection, Rectangle> pair in comboBoxBounds) foreach (KeyValuePair<Selection, Rectangle> pair in comboBoxBounds)