Solved

Overflow when minimizing!

Posted on 2004-03-31
6
347 Views
Last Modified: 2010-05-02
There are times when I have a Form floating above another form (vbmodeless).  The floating form does not have minimize/maximize/close enabled... (it's borderstyle is 0 / none).

When I attempt to minimize my application and keep the floating form visible, I get an overflow ('6') error.  Is there a way around this?

0
Comment
Question by:NO_CARRIER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 10727653
Please show your main (minimized) form_Resize event code
0
 
LVL 1

Author Comment

by:NO_CARRIER
ID: 10727873
it's not the resize code that is the error... it's the Form_Activate code that is probably the culprit.  There are a number of fixed size forms in the application... when Form1 is closed and Form2 is shown, I want it to appear in the same screen co-ordinates.  So I save the current coordinates into 2 variables.. (SetTop & SetLeft) ... which are then called on FormLoad / FormActivate.

Form Activate()
    Me.Top = SetTop
    Me.Left = SetLeft
End Sub
0
 
LVL 1

Author Comment

by:NO_CARRIER
ID: 10727887
hmm... error is gone if i simply put On Error Resume Next ...
but that's not really good programming structure.  
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
sokolovsky earned 115 total points
ID: 10728101
Check form state:
Form Activate()
 If Me.WindowState = vbNormal Then
    Me.Top = SetTop
    Me.Left = SetLeft
 End If
End Sub

But i think the problem is that SetTop or SetLeft have illegal data.
Form's property Top defined As Single, are you sure that SetTop returns Single?
0
 
LVL 1

Author Comment

by:NO_CARRIER
ID: 10728180
if windowstate=vbnormal on
Form Activate

and on Form Deactivate (Where it sets SetTop and SetLeft)

works fine... thank you!
0
 
LVL 28

Expert Comment

by:Ark
ID: 10728225
This error occured since vbMinimized form can not resize (while vbMaximized can). IMHO, better solution is:
If Me.WindowState = vbMinimized Then Exit Sub
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question