Results 1 to 6 of 6

Thread: moved from xp to windows 7 problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2013
    Posts
    3

    Lightbulb moved from xp to windows 7 problem

    Hi I have recently moved from Windows xp to 7. I have some older program that use the AxMSflexgrid. they are not published programs as I only used them locally. However I can no longer open these to work on in the editor as the reference to the flexgrid cannot be found. I can open individual vb.forms (e.g. form1.vb) but cannot open form1.design.vb. as I get this error " Me.Grid2 = New AxMSFlexGridLib.AxMSFlexGrid()" My question is - is it possible to recover these and change the flexgrid to datagridview. rewriting the code as I go along or have I lost these programs?
    Any advice would be appreciated

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    Re: moved from xp to windows 7 problem

    I've personally never worked with the ActiveX FlexGrid before, however with that being said I'm sure it's not to difficult to change the flexgrid to a datagridview. Taking a look at the properties of the FlexGrid here, there are some similarities and differences, but for the most part they're very similar.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

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

    Re: moved from xp to windows 7 problem

    If you can't open the forms in the designer then you obviously can't delete the FlexGrid control(s) in the designer. What you can do is open the designer code file and delete the field referring to the control. In the Solution Explorer, click the Show All Files button at the top. You can then expand the node for your form and it will show the user code field and the designer code file. Double-click the designer code file to open it in the code editor.

    You can then find the declaration for the Grid2 field and delete it. That will throw up some more errors where Grid2 is referred to in code, so you'll need to delete those lines as well. Once that's done, you should be able to open your form in the designer, add a DataGridView and then fix any other errors in your own code that still refer to the old FlexGrid.
    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

  4. #4

    Thread Starter
    New Member
    Join Date
    Jun 2013
    Posts
    3

    Re: moved from xp to windows 7 problem

    Hi Thank you for your reply. Its the fact I can't get to the designer to change them. The next answer from jmcilhinney is what I am looking for (I think !!)
    Thanks again for taking the trouble to respond
    Mickyfyn

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2013
    Posts
    3

    Re: moved from xp to windows 7 problem

    Hi

    Thank you for your prompt reply, I will try what you suggest. I did look at this method but was put off by the fact it said 'Do not modify it using the code editor'.
    Should keep me busy for a few nights.

    Thank you again

    Mickyfyn

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

    Re: moved from xp to windows 7 problem

    Quote Originally Posted by mickyfyn View Post
    Hi

    Thank you for your prompt reply, I will try what you suggest. I did look at this method but was put off by the fact it said 'Do not modify it using the code editor'.
    Should keep me busy for a few nights.

    Thank you again

    Mickyfyn
    Editing designer-generated code by hand should generally be avoided for two reasons:

    1. You might do something that will break the designer.
    2. Each time you make a change in the designer it will regenerate the code, possibly wiping out your change.

    Your designer is already broken though, so this is one of those situations where it's unavoidable. Taking a backup of your project before making any changes would probably be wise though.
    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