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
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
Re: about combine checkboxes values and boolean in property page
What was the error and what did you do to fix it?
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
Re: about combine checkboxes values and boolean in property page
What line of code blew up that you changed?
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