Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 5th, 2005, 6:43 PM   #1
brokenhope
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 126
Rep Power: 4 brokenhope is on a distinguished road
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 Sub

How can I fix this?
brokenhope is offline   Reply With Quote
Old Sep 5th, 2005, 7:31 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Make sure the form isn't minimised or maximised... duh...
If Not Me.Minimized And Not Me.Maximised Then
    ' do stuff
End If
I think.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 5th, 2005, 8:34 PM   #3
brokenhope
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 126
Rep Power: 4 brokenhope is on a distinguished road
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.
brokenhope is offline   Reply With Quote
Old Sep 6th, 2005, 1:24 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
That's it. Knew it was something like that.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:39 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC