Click to See Complete Forum and Search --> : The following causes a crash, know why?
Daniel_Christie
Oct 30th, 2000, 10:21 PM
Why does this cause a crash once I try to minimize the the app? The line in parentheses is the offender...but I need it to be set to this size becuase of where the cmdbuttons are for when the window state is 0 or 2.
Private Sub Form_Resize()
'This is activated every time that you resize the form
'either by controlbox or mouse resize
'eg.
txtNotepad.Width = Main.Width - 120
( txtNotepad.Height = Main.Height - 1150 )
cmdOpen.Top = Main.Height - 1100
cmdSave.Top = Main.Height - 1100
cmdExit.Top = Main.Height - 1100
End Sub
Daniel Christie
Daniel_Christie
Oct 30th, 2000, 10:33 PM
I believe I fixed it...well it works.
Do you think this is proper coding?
Private Sub Form_Resize()
'This is activated every time that you resize the form
'either by controlbox or mouse resize
'eg.
If Main.WindowState = 1 Then
GoTo Bottom
End If
txtNotepad.Width = Main.Width - 120
txtNotepad.Height = Main.Height - 1150
cmdOpen.Top = Main.Height - 1100
cmdSave.Top = Main.Height - 1100
cmdExit.Top = Main.Height - 1100
Bottom:
End Sub
Daniel Christie
Bjwbell
Nov 1st, 2000, 02:56 AM
Instead of useing the Goto statement you could have put all
the code inside the IF Then statement.
Like this
If Main.WindowState = 1 Then
txtNotepad.Width = Main.Width - 120
txtNotepad.Height = Main.Height - 1150
cmdOpen.Top = Main.Height - 1100
cmdSave.Top = Main.Height - 1100
cmdExit.Top = Main.Height - 1100
End If
End
In this case there isn't enough code to make a big difference but if you have a lot of code and some goto statements
it would be a lot of work to figure the code out.
Daniel_Christie
Nov 1st, 2000, 01:06 PM
I appreciate your keen suggestion, thankyou,
Daniel Christie
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.