|
-
Oct 30th, 2000, 11:21 PM
#1
Thread Starter
Addicted Member
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
-
Oct 30th, 2000, 11:33 PM
#2
Thread Starter
Addicted Member
Ah ha!...I got it, here is the results.
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
-
Nov 1st, 2000, 03:56 AM
#3
Addicted Member
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.
-
Nov 1st, 2000, 02:06 PM
#4
Thread Starter
Addicted Member
This is true, good suggestion.
I appreciate your keen suggestion, thankyou,
Daniel Christie
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
|