Converting VB6 to VB2010 using picturebox that is not redrawing
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Converting VB6 to VB2010 using picturebox that is not redrawing

Hybrid View

  1. #1
    Join Date
    Dec 2004
    Posts
    9

    Converting VB6 to VB2010 using picturebox that is not redrawing

    I have a vb6 project that uses a third party DLL that draws to a picturebox. I provide the handle of the Picturebox and it does the drawing, In VB6 I set AutoRedraw to True and the in the paint event I call the DLL's Refresh routine. Using the same code in VB2010 the graphics flicker for just a second and then disappear when I resize the picturebox. Is there a way around this in VB2010?

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Converting VB6 to VB2010 using picturebox that is not redrawing

    The third party DLL was designed to work with VB6 methods..

    Unfortunately in VS 2010, the Picturebox Drawing methods have changed completely, even down to the behind the scenes stuff us VB programmers don't see..

    Two Options...

    #1) .. Tank the DLL and draw the stuff yourself...

    #2) .. Get hold of the Third party and ask for a .NET version (Might even get a discounted price for upgrading)..

    For some interesting reading on why it does not work, check this article out..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Dec 2004
    Posts
    9

    Re: Converting VB6 to VB2010 using picturebox that is not redrawing

    Well I can not tank the DLLso that is not an optinand converting it to .NET may be an option. WHat I do not understand is the fact that I see the geometry and everything works fine. It just seems to me that resizing the form I should be able to refresh the geometry that was already displayed. If it can display it, you would think you would be able to refresh it as well.

    I will keep messing with it. There has to be a solution. Thanks for your help

  4. #4
    Join Date
    Dec 2004
    Posts
    9

    Re: Converting VB6 to VB2010 using picturebox that is not redrawing

    Here is some more information that may help someone to help me.

    If you resize the form manually the graphics and repaint correctly.

    So why would they not repaint on a maximized?

  5. #5
    Join Date
    Dec 2004
    Posts
    9

    Re: Converting VB6 to VB2010 using picturebox that is not redrawing

    Hmmm no more responses. Thanks for the advice Gremlin I will post back if I ever find a solution

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center