Results 1 to 8 of 8

Thread: [RESOLVED] MSFlexGrid ColWidth

  1. #1

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Resolved [RESOLVED] MSFlexGrid ColWidth

    I'm having slight problems with mentioned. Whenever user enters a certain value it varies for +/-5 (my scale is in twips):
    VB Code:
    1. With MSFlexGrid1
    2.     .ColWidth(.Col) = 200 'results in [U]195[/U]
    3.     'or...
    4.     .ColWidth(.Col) = 1000 'results in 100[U]5[/U]
    5. End With
    Can this be fixed and if so, how?

    It actually doesn't bother me (cause it's not even noticable) but it may bother the user. If he enters some value and he decides to change it later on it won't be the same. This may cause some doubts in my app...

    And here's another problem. I have set the minimum to be 200. It's fine when user enters 200 but if he wants to change it then it's suddenly 195... That doesn't seem right...

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MSFlexGrid ColWidth

    the screen can only show things in pixels - since a pixel is (usually) 15 twips (check Screen.TwipsPerPixelX/Y for your settings) the value given to the .ColWidth is rounded to the nearest pixel. i.e. 195 is divisible by 15, 200 is not.

  3. #3

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: MSFlexGrid ColWidth

    Simple yet efficient

    Thank you

    Btw...
    Quote Originally Posted by bushmobile
    ... since a pixel is (usually) 15 twips...
    ... i heard about that "usually" somewhere... are those 16:9 screens?

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MSFlexGrid ColWidth

    Not necessarily.. It's down to display settings, but many of them (not just aspect ratio) have the capability of changing the TwipsPerPixel (X and/or Y).

  5. #5

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: MSFlexGrid ColWidth

    Quote Originally Posted by si_the_geek
    Not necessarily.. It's down to display settings, but many of them (not just aspect ratio) have the capability of changing the TwipsPerPixel (X and/or Y).
    Can that cause any problems in my app?

  6. #6
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: MSFlexGrid ColWidth

    i thought it was primarily based upon the DPI that your display is set to.

    Quote Originally Posted by gavio
    Can that cause any problems in my app?
    kinda depends on your app - it's a good idea to test it under different display settings and assess it from there.

  7. #7

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: MSFlexGrid ColWidth

    Quote Originally Posted by bushmobile
    i thought it was primarily based upon the DPI that your display is set to.
    I'm pretty sure that would be correct - as a twip is 1/1440 of an inch.

    I was just refering to the fact that various things can affect it. I have noticed a few different things over the years, but am not sure what they were - "Large Fonts" may be one of them.

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