CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    1

    vb6 ActiveBar 2.0 - change button image

    I have an old VB6 app that uses DataDynamics' ActiveBar 2.0 for its toolbar and menus. I am adding a button to the toolbar and would like to alter the image displayed on that button based on different conditions in the program. The button is to remain active for each of three images.

    I can do it by adding a normal VB6 button and assigning a resource bitmap to its Picture attribute; I cannot add the button in the screen position I would like to, because that's in the middle of other buttons put there the way ActiveBar has you do it, but it is the best solution I've found so far and I'll go to production that way if I have to. The changing of images on this button is more important than its placement, though I don't like it this way.

    So what I'd like to do is find a way to load a new image onto the button within the ActiveBar toolbar. Further, I'd like to do this with an image out of a resource file, rather than out of a file on the disk. Currently the application has no files other than its executable in its install directory, and I'd like to keep it that way; the app keeps everything else it needs in a few values in the registry.

    I found a post for a routine the poster called "IconToTransparent" that looks interesting but incomplete, and it uses API calls which I don't fully understand. I'm not sure where that code gets some of the values that it uses, and am not even positive that it does what I want. However, if someone reading this is familiar with that and wants to expand on it, that might be easier than starting from scratch.

    I know this is an ancient control in an even more ancient language that is on its last legs. But can someone help me out?

    rc

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: vb6 ActiveBar 2.0 - change button image

    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Tags for this Thread

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

Featured