473,480 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 ~~

Jul 21 '05 #1
0 900

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

Similar topics

0
680
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
2158
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
5449
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
3123
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
7087
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...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4782
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...
0
4483
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.