Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Calling VB6 form from Windows Form changes controls style

Calling VB6 form from Windows Form changes controls style

Scheduled Pinned Locked Moved Visual Basic
comhelpcsharpdesign
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Crazy Joe Devola
    wrote on last edited by
    #1

    Hi I have a VB6 ActiveX that displays a form with some controls: text box, buttons, radio buttons, Sheridan date control. I call this form from a C# Windows form. This is done by a) adding a reference to the COM object b) instantiating the object c) Calling a method that displays the form. The problem is that when the form is displayed, the controls style changes: a) The text box becomes flat (not 3D) b) The command button edges are rounded c) The date control shows squares and funny shapes instead of numbers d) The raduo buttons, that are located inside a frame, are black. a and b are no big deal, c & d are obviously serious problem. If I display the form from a C# console application then there is no problem: the controls look exactly as they do in the VB design. Also, if I compile the form to an EXE and call the EXE from a C# windows form, there is no problem. It wasn't always like that: this problem started only recently, possibly as a result of Windows update, service pack... I am not sure what. Does anyone know of a way to fix that, or some Windows settings to fix the problem?

    D 1 Reply Last reply
    0
    • C Crazy Joe Devola

      Hi I have a VB6 ActiveX that displays a form with some controls: text box, buttons, radio buttons, Sheridan date control. I call this form from a C# Windows form. This is done by a) adding a reference to the COM object b) instantiating the object c) Calling a method that displays the form. The problem is that when the form is displayed, the controls style changes: a) The text box becomes flat (not 3D) b) The command button edges are rounded c) The date control shows squares and funny shapes instead of numbers d) The raduo buttons, that are located inside a frame, are black. a and b are no big deal, c & d are obviously serious problem. If I display the form from a C# console application then there is no problem: the controls look exactly as they do in the VB design. Also, if I compile the form to an EXE and call the EXE from a C# windows form, there is no problem. It wasn't always like that: this problem started only recently, possibly as a result of Windows update, service pack... I am not sure what. Does anyone know of a way to fix that, or some Windows settings to fix the problem?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Did you enable Visual Styles in your C# app?? Just a guess, but it's the only other thing I can think of that would change. If you suspect it's a service pack or patch, build a test machine to verify this, without the suspected patches and service packs. THen add each one until the problem shows up.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      C 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Did you enable Visual Styles in your C# app?? Just a guess, but it's the only other thing I can think of that would change. If you suspect it's a service pack or patch, build a test machine to verify this, without the suspected patches and service packs. THen add each one until the problem shows up.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        C Offline
        C Offline
        Crazy Joe Devola
        wrote on last edited by
        #3

        Thanks for that Dave. I didn't enable Visual Styles. I did find that if I go to My Computer | Properties | Advanced | Performance | Visual effects , and turn off "Use visual styles on windows and buttons", then it solves the problem with most of the controls I mentiod - text boxes, buttons, radio buttons. The only control I have a problem with now is the Sherida Calander control. I will look for a solution for this one now.

        C 1 Reply Last reply
        0
        • C Crazy Joe Devola

          Thanks for that Dave. I didn't enable Visual Styles. I did find that if I go to My Computer | Properties | Advanced | Performance | Visual effects , and turn off "Use visual styles on windows and buttons", then it solves the problem with most of the controls I mentiod - text boxes, buttons, radio buttons. The only control I have a problem with now is the Sherida Calander control. I will look for a solution for this one now.

          C Offline
          C Offline
          Crazy Joe Devola
          wrote on last edited by
          #4

          Replacing the Sheridan date control (SSCalendarWidgets_A.SSDateCombo) with the Microsoft Date Picker (MSComCtl2.DTPicker) solves the problem. But now I noticed there is a similar problem with the Sheridan grid: when a line is edited, the content of the field in focus is garbage :((

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups