PDA

Click to See Complete Forum and Search --> : [RESOLVED] [VB6]About some ActiveX control section bugs


joaquim
Oct 28th, 2009, 03:57 PM
i have Visual Basic 6.0 (SP6) Enterprise Edition.
i'm trying edit my control but by some strange situations i can't edit everything:(
i can get some strange bugs(i understand verythings in VB6 programming is why i'm felling strange):(
these section can be more updated, or someone can give me some advices?
thanks

joaquim
Nov 2nd, 2009, 12:26 PM
heres my groupproject.
enter in Groupproject file.
in groupproject see the teste form and on it click in Sprite1 control.
here click in cutom property, in IDE proeprty window... has you will see the VB6 will crashes(use CTRL+ALT+DELETE and select the right process(VB6.exe) and close it):(
how these problem happens: i just update the ActualSubImage property to be persistence property, and now the problem is here :(
confuse, but it's true.
anotherthing the right property page that gives the error is the Strips porperty page.
please anyone try to test and help me on these.....
i don't understand why these bug:(
thanks

joaquim
Nov 3rd, 2009, 12:03 PM
by some reason these sub:
Private Sub PropertyPage_SelectionChanged()
Static a As Boolean
If a = True Then Exit Sub
txtHeight.Text = SelectedControls(0).StripsHeight
txtWidth.Text = SelectedControls(0).StripsWidth
txtPosX.Text = SelectedControls(0).StripsLeft
txtPosY.Text = SelectedControls(0).StripsTop
txtImagensLinha = SelectedControls(0).StripsImagesLine
txtImagensColuna = SelectedControls(0).StripsImagesColumn
txtSeparaçãoHorizontal.Text = SelectedControls(0).StripsSeparationHorizontal
txtSeparaçãoVertical.Text = SelectedControls(0).StripsSeparationVertical
If SelectedControls(0).StripsActivate = True Then
chkActivarStrips.Value = 1
SelectedControls(0).ActualSubImage = 1
Else
chkActivarStrips.Value = 0
SelectedControls(0).ActualSubImage = 0
End If
If (UCase(SelectedControls(0).FileName) Like "*.ANI" Or UCase(SelectedControls(0).FileName) Like "*.CUR") Then
picVisualizar.Picture = SelectedControls(0).Img
Else
picVisualizar.Picture = LoadPicture(SelectedControls(0).FileName)
End If
Changed = False
a = True
End Sub
in Strips Property page was in loop.. i don't know why. i see these by puting 1 message box on it.
and for resolve the problem, i create the a variable. now i don't have the problem;)
but i continue with 1 question:
why these sub is in loop? is these possible?
thanks

joaquim
Nov 3rd, 2009, 12:17 PM
finally i found the real problem;)
Private Sub PropertyPage_SelectionChanged()
txtHeight.Text = SelectedControls(0).StripsHeight
txtWidth.Text = SelectedControls(0).StripsWidth
txtPosX.Text = SelectedControls(0).StripsLeft
txtPosY.Text = SelectedControls(0).StripsTop
txtImagensLinha = SelectedControls(0).StripsImagesLine
txtImagensColuna = SelectedControls(0).StripsImagesColumn
txtSeparaçãoHorizontal.Text = SelectedControls(0).StripsSeparationHorizontal
txtSeparaçãoVertical.Text = SelectedControls(0).StripsSeparationVertical
If SelectedControls(0).StripsActivate = True Then
chkActivarStrips.Value = 1
Else
chkActivarStrips.Value = 0
End If
If (UCase(SelectedControls(0).FileName) Like "*.ANI" Or UCase(SelectedControls(0).FileName) Like "*.CUR") Then
picVisualizar.Picture = SelectedControls(0).Img
Else
picVisualizar.Picture = LoadPicture(SelectedControls(0).FileName)
End If
Changed = False
End Sub
see the code and forgot the a variable. i found 2 lines that i coundn't put here:

SelectedControls(0).ActualSubImage = 1

and

SelectedControls(0).ActualSubImage = 0.
because the sub is only for read values, and by mistache i put these 2 lines... and only now i sod the problem.
sorry and thanks

dee-u
Nov 4th, 2009, 01:00 AM
Since this is resolved then you can mark it as such. =)

RobDog888
Nov 4th, 2009, 01:26 AM
Yes, SelectionChanged event to read your controls properties into your property page and ApplyChanges to write/update your controls properties that you had set.

joaquim
Nov 4th, 2009, 06:46 AM
Yes, SelectionChanged event to read your controls properties into your property page and ApplyChanges to write/update your controls properties that you had set.
the problem is resolved, but tell me, if you know, why that infinit loop happen?
thanks