|
-
Sep 5th, 2005, 03:51 PM
#1
Thread Starter
PowerPoster
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:
Public Property Get Width() As [COLOR=Red]Integer[/COLOR]
Width = UserControl.Width
End Property
Public Property Let Width(ByVal vNewValue As [COLOR=Red]Integer[/COLOR])
UserControl.Width = vNewValue
End Property
and internally the size grows, here is a snippet:
VB Code:
Public Sub Add(strCellName As String, strCellTagName As String, strCellValue As String)
On Error GoTo Err
'
m_NumCells = m_NumCells + 1
'
Load smrtCell(m_NumCells)
'
With smrtCell(m_NumCells)
.Height = CELL_HEIGHT
.Width = CELL_WIDTH
.Left = smrtCell(m_NumCells - 1).Left + CELL_WIDTH
.Top = 0
.Visible = True
.ProgramName = m_ProgramPrefix
.Tag = strCellName
.TagName = strCellTagName
'
If strCellTagName <> "" Then
.ReadOnly = False
.PadOnTouch = True
Else
.ReadOnly = True
.PadOnTouch = False
End If
'
.HookToHost
.Value = strCellValue
End With
'
[COLOR=Red]UserControl.Width = m_NumCells * CELL_WIDTH[/COLOR]
'
Exit Sub
Err:
If Err.Number = 6 Then
'
' OverFlow - (m_NumCells * CELL_WIDTH) greater than max integer value.
'
Exit Sub
'
End If
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|