![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 126
Rep Power: 4
![]() |
Form_Resize() problem
Every time I minimize my program I get this:
Run time error '348' Form cant be moved or resized while minimized or maximized And its because of this: Private Sub Form_Resize()
'Factor in everything for correct textbox resize.
If Me.Height < 6780 Then
Me.Height = 6780
End If
If Me.Width < 8970 Then
Me.Width = 8970
End If
'Resize textbox
txtText.Width = Me.ScaleWidth - (txtText.Left * 2) - 126
txtText.Height = Me.ScaleHeight - (txtText.Top * 2) - 200
rtbText.Width = txtText.Width
rtbText.Height = txtText.Height
'Move items | 126 is the amount of pixels of the size of frame and 5px border.
frmAdditionalCommands.Left = Me.ScaleWidth - 126 'Additional Commands Frame
frmLockProgram.Left = Me.ScaleWidth - 126 'Lock Program Frame
frmView.Left = Me.ScaleWidth - 126 'View Frame
frmTextBar.Top = txtText.Height + 16 'Text Bar (bold, italic, etc)
frmOptions.Top = frmTextBar.Top + frmTextBar.Height + 5 'Options Position
frmCalculator.Top = frmTextBar.Top 'Calculator Position
frmFooter.Top = frmOptions.Top + frmOptions.Height + 5 'Footer button position
frmCommands.Top = frmTextBar.Top
'Set Margin of rich text box
rtbText.RightMargin = rtbText.Width + 10000
End SubHow can I fix this? |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Make sure the form isn't minimised or maximised... duh...
If Not Me.Minimized And Not Me.Maximised Then
' do stuff
End If |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 126
Rep Power: 4
![]() |
Didnt work, the Minimized property doesnt exist, atleast not in that way... ah I got it, the property was window state, Instead If Not Me.WindowState = 1 Then... it seems it works fine when maximizing though for some reason 0_o, even though the error says otherwise. But it works now thanks.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|