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

September 7th, 2004, 07:09 AM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 7th, 2004, 07:14 AM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 8th, 2004, 08:03 AM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

September 8th, 2004, 11:18 AM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 9th, 2004, 01:52 AM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

September 9th, 2004, 02:45 AM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

September 9th, 2004, 07:52 AM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Any idea how I do that?
|

September 9th, 2004, 08:15 AM
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
In vb6 it was zorder (form1.zorder), I believe in .Net its form1.UpdateZorder, then the position I think
HTH
Duncan
|
|
 |