getmusicbee.com

Support => Developers' Area => Topic started by: karaluh on July 19, 2020, 07:59:34 PM

Title: How to make configuration panel controls skinnable?
Post by: karaluh on July 19, 2020, 07:59:34 PM
I created a label and a check box but they are using default Windows appearance and not MusicBee skin. How can I change it? Below is the screenshot and code.

Code
                Label playCountSyncLabel = new Label();
                playCountSyncLabel.Location = new Point(0, 25);
                playCountSyncLabel.AutoSize = true;
                playCountSyncLabel.Text = "synchronise from ListenBrainz to your library on startup:";
                // Check box.
                playCountSyncCheckBox = new CheckBox();
                playCountSyncCheckBox.Location = new Point(0, 43);
                playCountSyncCheckBox.AutoSize = true;
                playCountSyncCheckBox.Text = "synchronise Play Count";

(https://imgur.com/hrKzjxv)
Title: Re: How to make configuration panel controls skinnable?
Post by: Steven on July 20, 2020, 10:38:36 AM
their is a non-documented way that might work for text and combo boxes:
Code
control = MB_AddPanel(null, PluginPanelDock.TextBox);
control = MB_AddPanel(null, PluginPanelDock.ComboBox);
nothing was done for labels or checkboxes
but you can detect some skin colours
Code
Setting_GetSkinElementColour(SkinElement.SkinInputControl, ElementState.ElementStateDefault, ElementComponent.ComponentBackground);
use Color.FromArgb() to convert the number to a colour