Re: Fix the size of a tab control
- From: B. Meincke <garyallan@xxxxxxxxxxxxx>
- Date: Wed, 26 Mar 2008 06:24:00 -0700
Thanks for the effort, Stuart. We were on the same wavelength. I tried
placing two textboxes on the form to report the Top and Left values of the
tab control and they don't seem to update when the command buttons move
beyond their boundries, even though the control does, infact, resize.
<sigh>
Oh well, it's still fun even with the tab control expanding.
And, don't worry about my job, our administration is where I got my sense of
humour from...and I promise to have our database back to normal long before
it effects staff productivity!
--
BJM
ACE Assistant
Gary Allan High School
"Stuart McCall" wrote:
I had a quick play around with your code this morning, but was unable to.
prevent the resizing of the tab control. Here's what I tried:
Function MoveIt(strFormName As String, strControlName As String)
'On Error GoTo Proc_Error
Dim iMoveX As Integer
Dim iMoveY As Integer
Dim newLeft As Integer, newTop As Integer
Dim Ctl As Access.Control
Set Ctl = Forms(strFormName).Controls(strControlName)
iMoveX = Int(1000 * Rnd()) - 500
iMoveY = Int(1000 * Rnd()) - 500
again:
newLeft = Ctl.Left + iMoveX
If (newLeft + Ctl.Width) > (TabCtl0.Left + TabCtl0.Width) Then
newLeft = (TabCtl0.Left + TabCtl0.Width) - Ctl.Width
End If
If newLeft < TabCtl0.Left Then newLeft = TabCtl0.Left
Ctl.Left = newLeft
newTop = Ctl.Top + iMoveY
If (newTop + Ctl.Height) > (TabCtl0.Top + TabCtl0.Height) Then
newTop = (TabCtl0.Top + TabCtl0.Height) - Ctl.Height
End If
If newTop < TabCtl0.Top Then newTop = TabCtl0.Top
Ctl.Top = newTop
Beep
'Proc_Exit:
' Exit Function
'Proc_Error:
' Select Case Err.Number
' Case 2100
' iMoveX = -iMoveX
' iMoveY = -iMoveY
' Resume again
' Case Else
' MsgBox "Error " & Err.Number
' Resume Proc_Exit
' End Select
End Function
Maybe you have more time than I do to polish it off, but that's the gist of
what I meant previously.
Good luck, and if you get this implemented I hope you manage to keep your
job ;-)
- References:
- Re: Fix the size of a tab control
- From: Stuart McCall
- Re: Fix the size of a tab control
- From: Stuart McCall
- Re: Fix the size of a tab control
- From: B. Meincke
- Re: Fix the size of a tab control
- From: Stuart McCall
- Re: Fix the size of a tab control
- Prev by Date: Re: What is the name of the Language we are using & recommend book
- Next by Date: Re: Problem with option group
- Previous by thread: Re: Fix the size of a tab control
- Next by thread: problem with file dialog
- Index(es):