Results 1 to 6 of 6

Thread: about combine checkboxes values and boolean in property page

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    about combine checkboxes values and boolean in property page

    i'm using visual basic 6.
    i build a property page:

    Code:
    Private Sub PropertyPage_ApplyChanges()
        SelectedControls(0).Transparent = cboTransparent.ListIndex
        If cboTransparent.ListIndex = 2 Then SelectedControls(0).TransparentColor = PicTransparentColor.BackColor
        SelectedControls(0).GraphicMirror = cboMirror.ListIndex
        If chkStretch.Value = 0 Then
            SelectedControls(0).GraphicStrecht = False
        Else
            SelectedControls(0).GraphicStrecht = True
        End If
    End Sub
    i recive an error in second if... i don't hunderstand what isn't right.
    can anyone explain to me what isn't right?
    the GraphicStrecht property acept boolean values...
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: about combine checkboxes values and boolean in property page

    ok... i resolve the problem:
    Code:
    Private Sub PropertyPage_ApplyChanges()
        SelectedControls(0).Transparent = cboTransparent.ListIndex
        If cboTransparent.ListIndex = 2 Then SelectedControls(0).TransparentColor = PicTransparentColor.BackColor
        SelectedControls(0).GraphicMirror = cboMirror.ListIndex
        SelectedControls(0).GraphicStretch = chkStretch.Value
    End Sub
    
    Private Sub PropertyPage_SelectionChanged()
        cboTransparent.ListIndex = SelectedControls(0).Transparent
        PicTransparentColor.BackColor = SelectedControls(0).TransparentColor
        cboMirror.ListIndex = SelectedControls(0).GraphicMirror
        If SelectedControls(0).GraphicStretch = True Then
            chkStretch.Value = 1
        Else
            chkStretch.Value = 0
        End If
        Changed = False
    End Sub
    but i still confuse... why that error?
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: about combine checkboxes values and boolean in property page

    What was the error and what did you do to fix it?

  4. #4

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: about combine checkboxes values and boolean in property page

    i had these:
    Code:
    Private Sub PropertyPage_ApplyChanges()
        SelectedControls(0).Transparent = cboTransparent.ListIndex
        If cboTransparent.ListIndex = 2 Then SelectedControls(0).TransparentColor = PicTransparentColor.BackColor
        SelectedControls(0).GraphicMirror = cboMirror.ListIndex
        If chkStretch.Value = 0 Then
            SelectedControls(0).GraphicStrecht = False
        Else
            SelectedControls(0).GraphicStrecht = True
        End If
    End Sub
    and i change(fix) to these:
    Code:
    Private Sub PropertyPage_ApplyChanges()
        SelectedControls(0).Transparent = cboTransparent.ListIndex
        If cboTransparent.ListIndex = 2 Then SelectedControls(0).TransparentColor = PicTransparentColor.BackColor
        SelectedControls(0).GraphicMirror = cboMirror.ListIndex
        SelectedControls(0).GraphicStretch = chkStretch.Value
    End Sub
    error message was:
    "run-time error '438'
    object doesn't support these property or method"
    honestly these error put me confuse...
    thanks
    VB6 2D Sprite control

    To live is difficult, but we do it.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: about combine checkboxes values and boolean in property page

    What line of code blew up that you changed?

  6. #6

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,961

    Re: about combine checkboxes values and boolean in property page

    these:
    Code:
    If chkStretch.Value = 0 Then
            SelectedControls(0).GraphicStrecht = False
        Else
            SelectedControls(0).GraphicStrecht = True
        End If
    to these:
    Code:
    SelectedControls(0).GraphicStretch = chkStretch.Value
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

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



Click Here to Expand Forum to Full Width