Close Enough For Government Work

Discussion in 'OT Technology' started by Deus Ex Aethera, Apr 11, 2004.

  1. I have a yearlong senior-year college project that is coming to a close at the beginning of May. The project is to port some minefield simulation program that the Army is using from VS6 on WinNT4 to VS.NET on Win2k. I have a last minute error that I simply cannot figure out and I would appreciate any help that anyone familiar with Visual Basic .NET could offer.

    The GUI uses the MSFlexGrid control to display data in table form. There are several MSFlexGrids scattered throughout the program, and they all work perfectly...except one. One of them is always invisible at runtime and I've tried everything I can think of (Visible = True; MSFlexGrid.Show(); Top and Left = mouseclick coordinates, to make sure it's onscreen; rows and columns = 500 apiece, to make sure it's big enough to see, etc...) and NOTHING makes it visible onscreen.

    It's driving me insane, because all of the code that loads data into it and formats it to look right is all EXACTLY the same as the code for every other MSFlexGrid in the whole program --- not that the code is well-done, but that's beside the point.

    Does anybody have any idea if there's any .NET-related quirk that could be screwing with the control, or if there's some method I haven't thought of to force the control to appear? I know it's there; it has to be; I just can't see it. I'm about ready to say "screw it" and pretend it worked fine when I tested it.
     
  2. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    maybe try deleting the control and re-adding it with the same name? :dunno:

    or maybe you need to "bring to front" the control
     
  3. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Yeah I too would also try recreating the code/control. I once copied some vb code and when I pasted it, all of the tags/command words had changed :eek:

    Are you sure it's not another piece of code hiding that grid BTW?
     
  4. I already tried both things; no dice. It's like, during runtime, the grid control doesn't even exist in the window. It looks like VB.NET creates instances of design-time controls in the windows when they're loaded during runtime. Is it possible that the grid simply isn't getting instantiated into the window?
     
  5. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    it's possible that the IDE deleted the initializing code, but deleting the control, and re-creating it would have fixed it. Does any of your other code reference the control? If so, and it doesn't bomb, then it does exist. Maybe try debugging and looking at the runtime properties. You might have a hidden line of code somewhere that hides it or something?
     
  6. I fixed it. You'll never believe what caused the problem.

    There's a Sub somewhere in the project that assigns ToolTips to all of the controls in the project. I have no idea why, but the portion of code that assigns ToolTips to the grid also causes the grid to have a height and width of zero.

    Strange.
     

Share This Page