Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2004, 07:09 AM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form w/ datagrid pops up

Hello,

Here's a problem which drives me nuts:

I have an application with several forms open at the same time. One of the forms contains a datagrid, a dataset bound to the datagrid and an SqlDataAdapter. Every few minutes a timer fills the dataset with the results of a SELECT qwery.

The problem: Whenever the dataset changes, the form pops up and covers all the other forms of the application. It does that w/o becoming active - just pops up and get in the way.

Any idea why this happens or how I can stop it?

TIA


 
Old September 7th, 2004, 07:14 AM
Authorized User
 
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

What I suspect is happening is that the population of the dataset and grid forces the form to have focus, have you tried,

form.sendtoback

after the code that populates the grid, this should place the form to the back of the z-order



Duncan
 
Old September 8th, 2004, 08:03 AM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Duncan,

This should work, but it doesn't solve the problem entirely. First of all, the form will "flash" shortly while the datagrid is populated. Second, there might be times when the user wants the form to be on top of all other forms.


 
Old September 8th, 2004, 11:18 AM
Authorized User
 
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I did think that might be a problem, not sure what to suggest. by design the form is brought to the front of the zorder when it is activated, I suppose you could sending it to the back in the activate event but not sure whether that would work.



Duncan
 
Old September 9th, 2004, 01:52 AM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The thing is that the form is not activated, it just pops up in front of all other forms. The currently active form stays active but not on top of the z-order.

 
Old September 9th, 2004, 02:45 AM
Authorized User
 
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

If thats the case you should be able to override the zorder and force the form to remain in its current position. I've not tried this out in code myself, but I would have thought it possible.

Duncan
 
Old September 9th, 2004, 07:52 AM
Registered User
 
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any idea how I do that?

 
Old September 9th, 2004, 08:15 AM
Authorized User
 
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

In vb6 it was zorder (form1.zorder), I believe in .Net its form1.UpdateZorder, then the position I think

HTH

Duncan





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help - Mobile Web Form NO datagrid antiwind C# 1 August 29th, 2005 06:15 AM
On calling javascript function only one value pops shoakat Classic ASP Components 4 April 24th, 2005 06:07 PM
Using Datagrid...getting data on separate form Renu Classic ASP Databases 4 August 7th, 2004 09:52 PM
DataEntry form and DataGrid joblot VB How-To 0 May 5th, 2004 12:16 AM
DataGrid(Windows Form) shiju VS.NET 2002/2003 1 November 1st, 2003 11:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.