Link to home
Start Free TrialLog in
Avatar of rajesh_khater
rajesh_khater

asked on

Finding if the form is loaded

I am starting a form in Maximized mode.
The Form Resize event is getting fired before the Form Load event.
In the Form Resize event, I am resizing a DataGridView. but I get an error that row index is out of bounds.

What is the best way to trigger the resize code after the form is fully loaded?

I know I can keep a flag in Form Loaded and set it to true. Is there any other way?
Avatar of REA_ANDREW
REA_ANDREW
Flag of United Kingdom of Great Britain and Northern Ireland image

Can you post a snippet of your code?

Andrew
Why do you use Rowindex at all in Resize event? You should resize DataGrdiView's height, and width, and if necessary, Columns height.

Goran
Avatar of rajesh_khater
rajesh_khater

ASKER

I need to coz I want the grid's Height to be only as much as not to have any partially visible rows.

The code I am using is from:
https://www.experts-exchange.com/questions/22698846/How-NOT-to-have-partially-visible-rows-in-DataGridView.html
ASKER CERTIFIED SOLUTION
Avatar of Priest04
Priest04
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial