473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Exception on Form restore

I am experiencing an odd issue when my form is minimized. Upon activation,
my form refreshes some data within a DataGrid control. No exception is
thrown until the form is minimized, then restored from the task bar. Upon
restore, an exception is thrown in the Activated event. The exception is as
follows:

System.ArgumentException: '0' is not a valid value for 'value'. 'value'
should be between 'minimum' and 'maximum'.
at System.Windows.Forms.ScrollBar.set_Value(Int32 value)
at System.Windows.Forms.DataGrid.SetDataGridTable(Dat aGridTableStyle
newTable, Boolean forceColumnCreation)
at System.Windows.Forms.DataGrid.TableStylesCollectio nChanged(Object
sender, CollectionChangeEventArgs ccea)
at
System.Windows.Forms.GridTableStylesCollection.OnC ollectionChanged(Collectio
nChangeEventArgs ccevent)
at System.Windows.Forms.GridTableStylesCollection.Cle ar()
at MyProject.frmMyForm.FormatGrid()
at MyProject.frmMyForm.MyForm_Activated()

The exception occurs on a line of code that simply clears all TableStyles
from the DataGrid object (frmMyForm.MyDataGrid.TableStyles.Clear). Any ideas
as to why this only occurs when the form is restored from being
minimized?

--
Scott Adams
~~ not the Dilbert guy ~~
~~ not the creator of the Adventure series ~~

Nov 22 '05 #1
0 679

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Scott Adams | last post by:
I am experiencing an odd issue when my form is minimized. Upon activation, my form refreshes some data within a DataGrid control. No exception is thrown until the form is minimized, then restored...
1
by: 1388-2/HB | last post by:
For vb2005. At design time I set the main form's WindoState to Maximized and I disabled the Maximize box. The user can Minimize the application only. When the program launches, the form is...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
2
by: Alan Forsyth | last post by:
That rather long subject says it. In Access97 running on XP - I want to display a Maximized size Form01, then open a Restore size Datasheet View Form02 on top of the first Form. PopUp won't give...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.