I am using a DGV to display data from a DataTable but I've been unable to figure out how to prevent the user from clicking on a cell and selecting it. I'd use DataGridView.Enabled = False if it also didn't prevent the use of the scroll bar.
I also checked out the DataGridView.SetStyle(Selectable, False) member but that is protected so I can't touch it. Does anyone have any suggestions?
I've disabled all editing abilities (adding, deleting, reordering, etc) for it. Setting DataGridView.ReadOnly = true also doesn't work for me.
This problem can be solved with
Private Sub DataGridView3_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView3.SelectionChanged
DataGridView3.CurrentCell.Selected = False
You'll need to create a form to act as your splash screen. Once you've done that goto Project > Properties. Make sure the Application tab is selected. At the bottom there should be a combobox which is labeled 'Splash Screen'. Just select the form you'd like to use. That's it! If you'd like to adjust the minimum time it displays (I believe the default is 2 seconds) you can set 'My.Application.MinimumSplashScreenDisplayTime' in the new event of your form.
VS.NET 2005 (not the Express Editions) already comes with a SplashScreen template form. All you have to do is right-click your project in the Solution Explorer, click Add -> New Item..., then double-click the SplashScreen form. Give the form a name, and after it's added to your project, right click the form in the Solution Explorer and click View Code. The instructions for modifying the form are in the code comments.
Dave Kreskowiak Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
it's like this:
i want to close all open child forms in my mdi-container form - but not the container form - , when i confirm an openfiledialog.
the child forms show the contents of a database, and when i confirm the openfiledialog a new database is used in my programme. but i don't want the already open child forms to show the contents of the database used before, so all forms should be closed.
i tried it like this, but without success:
dim c as control<br />
for each c in form1.controls<br />
if type of c is form then<br />
dim f as form = ctype(c, form)<br />
end if<br />