Opton Buttons VB6 All Black

Discussion in 'AutoCAD' started by wlefferd, Feb 6, 2004.

  1. wlefferd

    wlefferd Guest

    I am in the process of updating some dll that were written in vb5 and ran in Acad2000 to vb6(sp5) which I want to run under Acad2004. All of the option buttons in frames turn black. If they are not in frames I can read them or if i compile the program as an exe file instead of a dll the option buttons in frames are readable. Has anybody else seen this? What have I missed

    Wayne Lefferd
     
    wlefferd, Feb 6, 2004
    #1
  2. Can you post a screenshot of the problem?




    under Acad2004. All of the option buttons in frames turn black. If they are not in frames I can read them or if i
    compile the program as an exe file instead of a dll the option buttons in frames are readable. Has anybody else seen
    this? What have I missed
     
    Tony Tanzillo, Feb 6, 2004
    #2
  3. Are you using a manifest in order to apply XP's visual style to your
    dialog?

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Feb 6, 2004
    #3
  4. wlefferd

    wlefferd Guest

    If I understand your question the answer is no. All of the properties were set in the properties box at design time.

    The operating system I am using is XP Professional if it matters.
    dialog?
     
    wlefferd, Feb 6, 2004
    #4
  5. If you're in a DLL that's loaded into AutoCAD you do not
    need a manifest file, because AutoCAD takes care of that.

    The problem is one that affects all VB applications that use
    the new UI (XP Themes).

    I can't say if this is going to work in VB, but it does in C++,
    so it may be worth a try. You have to declare the following
    function and call it in your Form's Initialize event. You will
    also need to exclude this for code that is not running on XP:

    Declare Function EnableThemeDialogTexture Lib "uxtheme" _
    Alias "EnableThemeDialogTexture" (ByVal hwnd As Long, _
    ByVal Flags As Long) As Long

    Usage:

    EnableThemeDialogText(SomeControl.hwnd, 2)

    The value 2 enables the texture background for the window.

    You can try passing the handle of your form, and/or the
    handles of each Frame control to this function.
     
    Tony Tanzillo, Feb 6, 2004
    #5
  6. Oops. The Usage should be:

    EnableThemeDialogTexture SomeControl.hwnd, 2
     
    Tony Tanzillo, Feb 6, 2004
    #6
  7. wlefferd

    Tom Craft Guest

    I just ran into the same problem. My VB6 dll was fine in Acad2000, but the same forms are all screwed up when compiled for Acad2004. In all cases except one, the option buttons inside of a frame are displayed with a black background color. The one exception has 4 option buttons in a frame, only one of these has the background color changed to black. I have made no other
    changes, the operation system has been XP Pro for sometime.

    Tom Craft
     
    Tom Craft, Feb 9, 2004
    #7
  8. wlefferd

    Tom Craft Guest

    I just ran into the same problem. My VB6 dll was fine in Acad2000, but the same forms are all screwed up when compiled for Acad2004. In all cases except one, the option buttons inside of a frame are displayed with a black background color. The one exception has 4 option buttons in a frame, only one of these has the background color changed to black. I have made no other
    changes, the operation system has been XP Pro for sometime.

    Tom Craft
     
    Tom Craft, Feb 9, 2004
    #8
  9. wlefferd

    Olaf Saether Guest

    I have found the same problem with Option buttons going black background.
    The frame font also suddenly goes blue and bold with the frame going through
    the text.
    The problem is only with XP and AutoCAD 2004 running in Dll.

    If you compile for AutoCAD 2000 with exactly the same form then the option
    buttons and frame fonts are fine. Somehow AutoCAD 2004 is affecting this and
    I don't have an answer.
    I will try Tony's suggestion.
    If you go to Windows Classic desktop in XP then behaviour with AutoCAD 2004
    is normal

    Olaf


    same forms are all screwed up when compiled for Acad2004. In all cases
    except one, the option buttons inside of a frame are displayed with a black
    background color. The one exception has 4 option buttons in a frame, only
    one of these has the background color changed to black. I have made no other
    ran in Acad2000 to vb6(sp5) which I want to run under Acad2004. All of the
    option buttons in frames turn black. If they are not in frames I can read
    them or if i compile the program as an exe file instead of a dll the option
    buttons in frames are readable. Has anybody else seen this? What have I
    missed
     
    Olaf Saether, Feb 18, 2004
    #9
  10. wlefferd

    GTVic Guest

    I have found a solution to this problem so even though this thread is old some people might find this useful.

    The solution of using the EnableThemeDialogTexture function did not work for me. Neither did using SP6 for Visual Basic 6.0

    What is happening is that VB6 apps/dlls do not have the built-in ability to take on the Windows XP look and feel (other than the titlebar.

    But if the DLL is run under AutoCAD 2004/2005 then the controls inside the form inherit the XP look. This only happens for AutoCAD 2004/2005 since they were built for XP (2000,2000i,2002 were not).

    The problem is that the Frame control in VB6 does not work correctly under XP. Anything inside a frame will flicker as the mouse moves around and the option buttons will show a black box where the text should be.

    One solution is not to use the Frame control. Or use a PictureBox control instead but the frame is not the same and it does not have a caption.

    The other solution is to use the Frame control and just have the controls sitting above it rather than in it.

    You cannot put labels above a frame control however so those have to stay inside the frame and then they will flicker which is very annoying. To solve that problem you can disable the frame and the labels and the frame will no longer flicker and they won't appear to be disabled.

    If you need to separate groups of option buttons then put them inside picture box controls and you can turn off the border of the picturebox so no one can tell they are there.
     
    GTVic, Sep 17, 2004
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.