2 Replies - 3775 Views - Last Post: 15 April 2009 - 04:54 PM Rate Topic: -----

#1 pezking7p  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-April 09

VB6 max form size? (Error: Overflow)

Posted 15 April 2009 - 12:52 PM

I am modifying a program..this program would print a graph and some corresponding data to paper. I would like it to take this data and instead open a new form and print the graph and that data to the form so that it can be viewed on the computer. My form needs to be scrollable, be able to contain multiple pictures and text. Since this is already being done using the .print method, it is easiest to use an object that allows me to reuse this code.

My solution was to use a picturebox to contain the graph (which is a copy->pasted picture) and the text--the picturebox also allowed me to add scrollbars to the default VB form. This code works perfectly until I try to print the data from more than 4 graphs at once, any more than 4 graphs and the program crashes with a "runtime error 6: Overflow" error. I thought I might be overflowing my picturebox, so I created several pictureboxes and intended to stack the pictureboxes end-to-end at runtime and activate each picturebox as I print to it, like this:

Private Sub Form_Load()
	Dim x As Integer

	For x = 0 To 7
		frmGraphs.picCanvas(x).Top = x * 4* 7200
		frmGraphs.picCanvas(x).Visible = False
	Next

End Sub



However, I discovered that as soon as I tried to place my second picturebox (ie, the picturebox that would hold the 5th graph) my program errored out again. I now realize that I am actually overflowing my form's maximum size.

My limited experience has me struggling to find an alternative option. Is there a modified VB form I can use instead of the default that is larger? Can I modify the form object myself? Am I missing something obvious that I could be using instead? I tried using richtextbox, listfield/listview, I've also looked at a PDF module that will open a pdf within the program, but it will only accept .jpg pictures and since I am copy/pasting my pictures they are .bmp and I want to avoid converting them.

Any help is greatly appreciated. Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: VB6 max form size? (Error: Overflow)

#2 GreaseMonkey  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 33
  • Joined: 23-March 09

Re: VB6 max form size? (Error: Overflow)

Posted 15 April 2009 - 02:31 PM

you can modify it yourself yes using the form1.width and form1.height controls but remember that the height and width have a max as they are no doubt long values, i would personally consider a different aproach to get around this error
Was This Post Helpful? 0
  • +
  • -

#3 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 92
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: VB6 max form size? (Error: Overflow)

Posted 15 April 2009 - 04:54 PM

Try this. If you want to use an error handler, just ask :P

Dim x As Double


This post has been edited by firebolt: 15 April 2009 - 04:55 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1