|
I'm aware that I can go myForm.TopMost = true to make a form be the topmost window in my app. However, setting this property to true also makes myForm the topmost window for all processes running; for example if I run a new instance of Internet Explorer, myForm will still be the top most window.
How do make a form be the topmost window ONLY for my app?
The graveyards are filled with indispensible men.
|
|
|
|
|
TopMost makes the dialog a system modal dialog. To make a application modal dialog, use Form.ShowDialog as opposed to Form.Show .
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thank you Heath for your reply. I am also aware of the .ShowDialog method, but unfortunately that's not the functionality I'm looking for; I want to be able to work in the other background windows while some other Form is the top-most.
An example of what I want:
Visual Studio's Find & Replace dialog box - it is top-most ONLY when Visual Studio is the active app, and it allows you to still work in the background window.
The graveyards are filled with indispensible men.
|
|
|
|
|
Judah H. wrote:
Visual Studio's Find & Replace dialog box - it is top-most ONLY when Visual Studio is the active app, and it allows you to still work in the background window.
o Make sure TopMost = false in your modeless form.
o Call SetTopLevel(true) in your modeless form's constructor.
o In the parent form, to display the new form:
frmAppTopMost frm = new frmAppTopMost();
this.AddOwnedForm(frm);
frm.Show();
I have this working in an MDI app -- haven't tried it in a dialog based app.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Wonderful, works beautifully, Roger thank you.
The graveyards are filled with indispensible men.
|
|
|
|
|
Hi,
I need to pass a timespan value in a RowFilter expression of a DataView (in the format hh.mm.ss) but i don't know which is the correct sintax to do that ...
I tryed enclosing the value in # (like for date values) but it doesn't work
...
any idea??
thanks in advance
|
|
|
|
|
A TimeSpan itself is not valid in an expression. See the DataColumn.Expression documentation for details about valid expressions.
Depending on your needs, though, you could calculate a particular pair of dates then do a filter like:
myDataView.Filter = "PurchaseDate >= #1/1/2000# AND PurchaseDate < #1/1/2004#"; substituting the given dates with your variables (use string.Format or a StringBuilder rather than multiple concatenations which is very ineffecient).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
thanks for the answer...
however my problem is not for date value but Time values...
for example :
The db type of the information is TIME (ex. 12.23.45) and it is stored in DataSet as Timespan when i retrive it by Fill Method (DataAdapter) at the beginning...
My problem is to retrieve one or more record from DataTable filtering with an expression like this
myDataView.Filter = "TIME = 12.23.45"; (TimeSpan Value???)(like this dont work)
thanks
|
|
|
|
|
Hi all
i have a c# windows application project. When i press the "close" box, i receive the error below. Does anyone know what should i do to fix this error?
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
thanks
Ozgur Nevres
|
|
|
|
|
Does your form override OnClosing or OnClosed , or does anything else (including your form) handle the Closing and Closed events? If so, something is invoking (either directly calling or invoking via reflection) a method that isn't getting passed the right arguments.
If this isn't the case, something somewhere is calling a method with an argument that is not acceptable (for instance, passing a value that doesn't represent a single enum member or a flagged enum). The best way to find this out is to actually read the documentation for the classes, methods, properties, et. al. that you're using. Almost every member in the .NET base class library (BCL) gives at least directly-thrown exceptions that could be thrown and why they would be thrown, including what values are allowed for a particular parameter.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks for your care.
Yes, i handle the Closing event. My eventhandler is below:
(Note: the error does not occur always, it occurs sometimes ( 1 in 10, average )
private void Server_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
if ( !CheckOnlines() )
e.Cancel = true;
}//End of Private Method Server_Closing.
and my CheckOnlines method:
private Boolean CheckOnlines()
{
int i = this.m_iNumOfOnlineOperators
+ this.m_iNumOfOnlineVisitors;
if ( i > 0 )
{
TextObject objTO = ( TextObject )
this.m_htTexts["Server_CheckOnlines_Msg2"];
String strMsg = objTO.TextValue;
strMsg = strMsg.Replace(
"@", this.m_iNumOfOnlineOperators.ToString() );
strMsg = strMsg.Replace(
"$", this.m_iNumOfOnlineVisitors.ToString() );
objTO = ( TextObject )
this.m_htTexts["Server_CheckOnlines_Msg1"];
DialogResult dr = MessageBox.Show(
this, strMsg, objTO.TextValue, MessageBoxButtons.YesNo,
MessageBoxIcon.Information );
if ( dr == DialogResult.Yes )
{
return true;
}//End of if ( dr == DialogResult.Yes ).
else
{
return false;
}//End of else.
}//End of if ( i > 0 ).
else
{
return true;
}//End of else.
}//End of Private Method CheckOnlines.
|
|
|
|
|
It's hard to see where an error might occur, so you should try debugging that method and seeing on which line the exception is thrown. You should also try stepping through the code (put a breakpoint on the first line of your Closing handler and step into each line. The low reproducability rate might make that a little tedious, but that's the world of software development. You could also use Debug.Assert which may speed up the process a little. Good luck!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have visual studio .NET 2003 but how do I create a project in C# ? If I go to New -> Projects I get all the managed C++ items but how can I create C# projects? If I just create a file, I do not have the option of a .cs file - must I download something or will it compile .cs files as it is?
Obseve everything, remember more...
|
|
|
|
|
Check our VS.NET installation. Have you installed C# support?
|
|
|
|
|
No, how do I install C# support?
Obseve everything, remember more...
|
|
|
|
|
Re-run the setup and select C# when choosing installation components. If C# is not an option, then you only bought Visual C++ .NET and not the full studio. Either buy the full studio or buy C# .NET to go along with it. If you can return Visual C++ .NET, I'd recommend doing that and getting the full studio since it'll most likely cost you less than buying two separate components.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks
Obseve everything, remember more...
|
|
|
|
|
how do i remove/hide/clear control border? i need datagrid, listiew, listbox or textbox that has no border, and i use it in .NET Compact Fromework on WinCE 3.0
please help... Thanks
|
|
|
|
|
Set the "BorderStyle" property to "None", if it exists in .NET Compact Framework.
|
|
|
|
|
property BorderStyle is not available for .NET Compact Framework. I want it to be programaticly hiding control border.
|
|
|
|
|
Hi,
I'm getting the following error "The request failed with http status 404: Not Found" when trying to execute a web method on a web service from a client windows app. The webservice works fine when running the web service on it's own. I've tried updating the web reference, removed the Web Service and added a new one and ported the code over to the new WebService, basically tried everything I can think of but no success.
Does anyone have any ideas?
Thanks in advance.
|
|
|
|
|
Are you providing all parameters of the correct Type when calling the method? If you are using inherited objects, try casting them to the parameter
Type instead of relying on the CLR to handle it. This may be causing a problem with resolving the correct web method. <br />
<br />
<div style="width: 100%; font-size: 4px; margin-bottom: -10px; background-color: rgba(255, 153, 0, 1)"> </div><br />
-----BEGIN GEEK CODE BLOCK-----<br />
<a href="http://www.geekcode.com/geek.html">Version: 3.21</a><br />
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++<br />
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Looks to be OK in regards to both of your suggestions.
Thanks for trying
|
|
|
|
|
Hi
"The request failed with http status 404: Not Found"
|
|
|
|
|
Thanks for your helpful advice in using UserControl in web!
I did a windows service to serve my application . I use socket to send and receive data from and to application , but it has more time to transfer large data .What's technique that I can use for improve my speed .My application and service are running in same host .
Thanks for your help!
|
|
|
|