private void SetText(byte value) { string newText = HTMLColor.MakeSureIsTwo(HTMLColor.Hex(value)); //If newText.Length < 2 Then newText = "0" & newText txtHex.Text = newText; txtDec.Text = value.ToString(); }
private void sldValue_ValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs <Double> e) // Handles sldValue.ValueChanged { byte val = (byte)sldValue.Value; tbPercent.Text = String.Format("{1:##%}\r\n{0}\r\n{2:X2}", val, (val / 255.0), val); if (LinkedValue != null) { LinkedValue.Value = val; } if (txtHex.Text != HTMLColor.Hex(val) || txtDec.Text != sldValue.Value.ToString()) { SetText(val); //SetBackColor(val) } if (!IgnoreChangeEvent && Parent != null) { Parent.updateDisplayColor(); } }