Results 1 to 7 of 7

Thread: [RESOLVED] [VB6]About some ActiveX control section bugs

  1. #1

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

    Resolved [RESOLVED] [VB6]About some ActiveX control section bugs

    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
    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,959

    Re: [VB6]About some ActiveX control section bugs

    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
    Attached Files Attached Files
    VB6 2D Sprite control

    To live is difficult, but we do it.

  3. #3

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

    Re: [VB6]About some ActiveX control section bugs

    by some reason these sub:
    Code:
    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
    Last edited by joaquim; Nov 3rd, 2009 at 01:11 PM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4

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

    Re: [VB6]About some ActiveX control section bugs

    finally i found the real problem
    Code:
    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
    VB6 2D Sprite control

    To live is difficult, but we do it.

  5. #5
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: [VB6]About some ActiveX control section bugs

    Since this is resolved then you can mark it as such. =)
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [VB6]About some ActiveX control section bugs

    Yes, SelectionChanged event to read your controls properties into your property page and ApplyChanges to write/update your controls properties that you had set.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

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

    Re: [VB6]About some ActiveX control section bugs

    Quote Originally Posted by RobDog888 View Post
    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
    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