2 Replies - 4360 Views - Last Post: 30 January 2013 - 08:46 PM Rate Topic: -----

#1 nicold  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 29-January 13

change text color in textbox with scroll bar

Posted 30 January 2013 - 01:47 AM

i want to change the text color in textbox1 with scroll bar. if i moved the scroll bar the opacity of the font color should also change to dark is it possible if then please help
Is This A Good Question/Topic? 0
  • +

Replies To: change text color in textbox with scroll bar

#2 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: change text color in textbox with scroll bar

Posted 30 January 2013 - 02:07 AM

by using Hscrollbar contol you can do it. take 3 hscrollbar and a button, after scrolling all tree click button.

    Private Sub HScrollBar1_Scroll()
        TEXTBOX1.ForeColor = Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value, HScrollBar3.Value)
) 
End Sub

' DO THE SAME FOR OTHER TWO SCROLLBAR ALSO.
  
    


 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        HScrollBar1_Scroll()
    End Sub


YOU CAN ALSO SET TEXT TO BOLD ...

This post has been edited by kai_itz me: 30 January 2013 - 08:47 PM

Was This Post Helpful? 0
  • +
  • -

#3 kai_itz me  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 159
  • Joined: 03-August 12

Re: change text color in textbox with scroll bar

Posted 30 January 2013 - 08:46 PM

The above code may not work in vb6 .. so try this

FOR VB6

Private Sub Form_Load()
        HScroll1.Value = 0
        HScroll2.Value = 0
        HScroll3.Value = 0

        HScroll1.Max = 255
        HScroll2.Max = 255
        HScroll3.Max = 255


        HScroll1.Min = 0
        HScroll2.Min = 0
        HScroll3.Min = 0

        Textbox1.FontBold = True
    End Sub

    Private Sub HScroll1_Change()
        Textbox1.ForeColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
    End Sub

    Private Sub HScroll2_Change()
        Textbox1.ForeColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
    End Sub

    Private Sub HScroll3_Change()
        Textbox1.ForeColor = RGB(HScroll1.Value, HScroll2.Value, HScroll3.Value)
    End Sub


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1