Results 1 to 1 of 1

Thread: UserControl.Width (Integer maximum reached) - how to exceed?

Threaded View

  1. #1

    Thread Starter
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    UserControl.Width (Integer maximum reached) - how to exceed?

    All,

    I have a custom usercontrol, its .Width grows at run-time. It grows to the right by leaps and bounds. I end up exposing this Property in code:

    VB Code:
    1. Public Property Get Width() As [COLOR=Red]Integer[/COLOR]
    2.     Width = UserControl.Width
    3. End Property
    4.  
    5. Public Property Let Width(ByVal vNewValue As [COLOR=Red]Integer[/COLOR])
    6.     UserControl.Width = vNewValue
    7. End Property

    and internally the size grows, here is a snippet:

    VB Code:
    1. Public Sub Add(strCellName As String, strCellTagName As String, strCellValue As String)
    2. On Error GoTo Err
    3.     '
    4.     m_NumCells = m_NumCells + 1
    5.     '
    6.     Load smrtCell(m_NumCells)
    7.     '
    8.     With smrtCell(m_NumCells)
    9.         .Height = CELL_HEIGHT
    10.         .Width = CELL_WIDTH
    11.         .Left = smrtCell(m_NumCells - 1).Left + CELL_WIDTH
    12.         .Top = 0
    13.         .Visible = True
    14.         .ProgramName = m_ProgramPrefix
    15.         .Tag = strCellName
    16.         .TagName = strCellTagName
    17.         '
    18.         If strCellTagName <> "" Then
    19.             .ReadOnly = False
    20.             .PadOnTouch = True
    21.         Else
    22.             .ReadOnly = True
    23.             .PadOnTouch = False
    24.         End If
    25.         '
    26.         .HookToHost
    27.         .Value = strCellValue
    28.     End With
    29.     '
    30.     [COLOR=Red]UserControl.Width = m_NumCells * CELL_WIDTH[/COLOR]
    31.     '
    32.     Exit Sub
    33. Err:
    34.     If Err.Number = 6 Then
    35.         '
    36.         ' OverFlow - (m_NumCells * CELL_WIDTH) greater than max integer value.
    37.         '
    38.         Exit Sub
    39.         '
    40.     End If
    41. End Sub

    So, the UserControl.Width is defined as a Integer Type. This is beyond my ability to modify as someone else (Microsoft) created UserControls.

    I need my control to grow more than the Integer can allow. I think this means the maximum size (in pixels) is 32,768 (2^15).

    I need it to be bigger, but I cannot change the fact that the UserControl.Width is limited to a number that fits in an Integer.

    I suspect this could be overcome using a different scalemode, other than twip . Any thought/suggestions?

    Thanks!

    Dave
    Last edited by Dave Sell; Sep 5th, 2005 at 03:59 PM. Reason: Twip update
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

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