Results 1 to 6 of 6

Thread: VB6 OCX in C# - Mdichild form issues

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Question VB6 OCX in C# - Mdichild form issues

    I have a graph component (ocx) written in VB6, on the graph there is a toolbar.

    I have added the graph to a C#.net application. The graph works fine with normal windows, however when its placed on a mdichild form all of the graph (ocx) toolbar buttons disappear, the toolbar appears as a blank rectangle.

    I know this is a bit of a weird one, but has anyone got any ideas?

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB6 OCX in C# - Mdichild form issues

    Do you have a ToolStrip in the parent window?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Re: VB6 OCX in C# - Mdichild form issues

    Yes, the MDIParent has a toolstrip.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB6 OCX in C# - Mdichild form issues

    It will be the tool bars trying to merge then I'd guess. Look at the your parent form's ToolStrip properties, and maybe the items too, relating to merging. The ToolStrip.AllowMerge property would be the place to start, although I thought that it was False by default. Maybe your child window is trying anyway and is messing things up. Interoperability between .NET and VB6 is not 100%.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Re: VB6 OCX in C# - Mdichild form issues

    Thanks for the info - However I've tried changing the allowmergre to false and I also tried removing the MDIParent Toolbar altogether, but I've still got the same problem.

    The only solution I can come up with is to replace the toolbar will a load of buttons in a frame. Seems a bit naff though.

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: VB6 OCX in C# - Mdichild form issues

    That's Interop for you. It has limitations and it appears as though this might be one of them.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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