Results 1 to 6 of 6
  1. #1
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts

    Text (Color?) (VB6)

    With the following code:
    Option Explicit
    Private Sub Form_MouseDown(Button As Integer, _
    Shift As Integer, _
    X As Single, _
    Y As Single)
    ' Is the left button down"
    If Button = 1 Then
    txtResult.Text = "Left button is currently down."
    End If
    ' Is the left button down"
    If Button = 2 Then
    txtResult.Text = "Right button is currently down."
    End If
    ' Is the middle button down"
    If Button = 3 Then
    txtResult.Text = "Middle button is currently down."
    End If
    End Sub
    Private Sub Form_MouseUp(Button As Integer, _
    Shift As Integer, _
    X As Single, _
    Y As Single)
    ' Clear the content of the text box
    txtResult.Text = ""
    End Sub
    Private Sub cmdExit_Click()
    End
    End Sub

    the code works... but (uh-huh)
    When the text is displayed, it looks kinda like it has been grayed out... and the color is set to black - all "0"s

    What property am I not setting?

    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text (Color?) (VB6)

    The code you posted has nothing to do with the color of the text box. Does the Enabled property of the text box happen to be set to False? That would cause the text to be greyed out.

  3. #3
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts

    Re: Text (Color?) (VB6)

    Hans:

    That was it... thanks...

    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text (Color?) (VB6)

    If you don't want the user to be able to edit the text in the text box, you can set its Locked property to True instead of setting its Enabled property to False.

  5. #5
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts

    Re: Text (Color?) (VB6)

    Hans:

    Thnaks, I was wondering about that. Why don't they teach it that way? It seems more precise.

    Regards,
    Chuck Billow

    With high hope for the future, no prediction is ventured.
    -- Abraham Lincoln
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Text (Color?) (VB6)

    It depends on what you want. In some situations, you might want to give users a visual clue whether they can enter anything in a text box. Setting Enabled to True or False does that, setting Locked to False or True doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •