I'm trying to set the font color in a richtextbox (rtbSample) based on the position of 3 scrollbars (scrRGB(0,1,2))and it's rgb value in a textbox (txtRGB) but it just won't work. Any ideas?
Code:Private Sub scrRGB_Change(Index As Integer) Dim CombinedValue As Long CombinedValue = RGB(scrRGB(0).Value, scrRGB(1).Value, scrRGB(2).Value) txtRGB.Text = "&H" & CombinedValue picRGB.BackColor = CombinedValue End Sub 'scrRGB_Change(Index As Integer) Private Sub txtRGB_Change() rtbSample.SelStart = 0 rtbSample.SelLength = Len(rtbSample.Text) rtbSample.SelColor = txtRGB.Text End Sub Private Sub txtRGB_GotFocus() If Len(txtRGB.Text) > 0 Then txtRGB.SelStart = 0 txtRGB.SelLength = Len(txtRGB.Text) End If End Sub 'txtRGB_GotFocus()




Reply With Quote