|
Application Tools :Pocket PC 2003 , WINCE.NET , .NET CF , VC#
My startup form has 6 buttons ..each allowing user to jump to next screen.
Also every other screen returns to startup screen.
When I execute the application & navigate thru.
Every time i see a new instance of my startup form created at background.
i.e, when i leave my startup screen that particular instance doen't get closed/disposed.
My project requirements doesn't allow me to do FindWindow and DestroyWindow.
Could anyone suggest me why it is happenning and how to control it.
Thanks,
Ratna
|
|
|
|
|
Anonymous wrote:
i.e, when i leave my startup screen that particular instance doen't get closed/disposed.
It better not get closed, otherwise your app will quit.
Anonymous wrote:
When I execute the application & navigate thru.
Every time i see a new instance of my startup form created at background.
Is this new instance being created by the new form you .Show()? Your new form show NOT be creating a new instance of your main form. Your new form show just close gracefully and control will return to the main form.
This is all speculation, of course, because we haven't seen any code that show's what your forms are doing when they get created and closed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
........................................
Application.Exit will quit my application.
Form.Close/Dispose will close all child windows and then close itself.
But why is it creating multiple instance.
When you are running application ... go to memory-running programs ..u will see all the instances of form running.
Thats were i detected this problem.
................................
|
|
|
|
|
Anonymous wrote:
Application.Exit will quit my application.
Form.Close/Dispose will close all child windows and then close itself.
The end result is the same...
Anonymous wrote:
When you are running application ... go to memory-running programs ..u will see all the instances of form running.
I don't have a Pocket PC, or the development environment...
Like I said, we haven't seen any code, so we can't tell you wants going wrong. Also, questions related to Pocket PC are better handled in the Embedded/Mobile Forum.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
It is hard to tell by the information you have provided, but if i understand correct you run the first form as the main thread. Then you try to open several other forms from that form, and then close the first form.
But if you have made the first form the main thread, this will not close untill you end he program.
To avoyd the problem, try to not call the forms from the other form, have a background main thread that handles all forms.
Hope this make sence
regards
|
|
|
|
|
Hi there!
I'm doing a network application which send and receive files. Here's a quick description of the app:
1. It can receive files from multiple user at the same time.
2. A) When I want to receive from a different user I have to open another port.
B) I'm using sockets, that's reason for point "2. A)" :P
Now, I want to be able to receive multiple files from multiple users at the same time but with only one port. Like file sharing apps (Kazaa, eMule ,etc.) How can I do this?
Thanks a lot
Gimpy1983
----------------------
Be proud. Be yourself.
|
|
|
|
|
I added a new project of type 'setup wizard' for 'a windows application'. All the files in the resulting setup install into the same directory. How can I get the install to distribute files in the same directory structure as the 'Source Path'?
There is a folder property for each item to be installed, but it does not let me set and explicit path.
thansk
|
|
|
|
|
|
Tell you how what? I don't see anything - It just redirects to the home page.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Oh.. cm'on.. It is there.. refresh the page..
ok It's the left colum in a datagrid I want to remove it.
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
Everything you wanted to know about DataGrid but were too afraid (ok you weren't) to ask.
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp
Gary
|
|
|
|
|
thanx.. and I have asked a few questions on datagrid.. I will ask more..
That link is big!! It's sturday tomorrow.. I plan to watch spiderman2.
so.. push the FAQ onto monday!
_____________________________________________________
Believe! Every thing has a purpose
|
|
|
|
|
I have created two forms:
One for the details, in which you can search on a particular field. If you right-click the field and click search, you get a form with a grid displaying the search results.
The second form uses the same dataset, with a dataview in front of it. So the forms are linked to the same datasource. But I want to synchronize them, so If I double-click a record in the grid I get the details of the record in the detail form.
How can I do this?
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
I wouldn't recommend sharing the CurrencyManager , which wouldn't work anyway since your binding contexts are technically different (one form binds to a DataSet while the other binds to a DataView , even though it is over a DataTable within the same DataSet - binding contexts must be exactly the same).
I would recommend using the event model. Define an event on one or both of the forms (depending on whether or not you want one-way or two-way synchronization) that when a button is clicked (or whatever you use for navigation), an event is also raised that the other form handles and increments it's CurrencyManager.Position as well. This also gives you a little more flexibility with future development.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for the info
"Every rule in a world of bits and bytes can be bend or eventually be broken"
|
|
|
|
|
public class Test
{ private int num1; private int num2;
private int num3
[CategoryAttribute("BlackGround")]
public int Num1
{get{return num1;} set{num1=value;}}
[CategoryAttribute("BlackGround")]
public int Num2
{get{return num2;} set{num2=value;}}
[CategoryAttribute("ForeGround")]
public int Num3
{ get{return num3;} set{num3=value;} }}
How get the Serialization result as below?
<Test>
<BlackGround>
<Num1>..</Num1>
<Num2>..</Num2>
</BlackGround>
<ForeGround>
<Num3>..</Num3>
</ForeGround>
</Test>
ok
|
|
|
|
|
You want to post this every two hours? Show a bit patience!
If you just wanted to change your posting use the modify link instead of starting a new thread.
|
|
|
|
|
i know ,but i didn't know why this xml tag do disappear?
ok
|
|
|
|
|
Try to set the "Do not treat <'s as HTML tags" option which can be found below the text-control or use the HTML extended character codes.
|
|
|
|
|
Or escape the tags themselves using < for < and > for > .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i kown,bu i don't know why the xml tag became disappeared!
ok
|
|
|
|
|
Hello, i wanted to know if anybody knows of a good reference to study the TCP/IP protocol programming with C#, the way you structure packets, compression/decompression etc.
|
|
|
|
|
|
I'm creating a button that opens a popup window when clicked, to display further options. I locate the topleft corner of the control at same location as button itself, by using mybutton.PointToScreen. No problem.
When the button is too close to the bottom of screen I locate the popup at location
mybutton.PointToScreen.Y - popup.Height + mybutton.height (i.e. open it upwards instead of downwards in a sence...)
This all works fine, if I use normal fonts. However when using larger font size in windows it becomes a problem for me.
the code looks like this:
<br />
Popup popup = new Popup();<br />
<br />
Rectangle screenBounds = Screen.GetBounds(this.Location);<br />
<br />
float scaleY = Form.GetAutoScaleSize(this.Font).Height / 13.0f;<br />
float scaleX = Form.GetAutoScaleSize(this.Font).Width / 5.0f;<br />
<br />
Point ButtonLocation = ((Control)sender).PointToScreen(Point.Empty);<br />
int x = ButtonLocation.X;<br />
int y = ButtonLocation.Y;<br />
<br />
if( screenBounds.Bottom < (y+popup.Height) )
{<br />
if( eventButtonLocation.Y < popup.Height )<br />
popup.Height = eventButtonLocation.Y; <br />
<br />
y = (eventButtonLocation.Y - popup.Height + eventLabel.Height);<br />
}<br />
<br />
if(screenBounds.Right < (x + popup.Width) )
x = x - popup.Width + ((Control)sender).Width;<br />
<br />
popup.Location = new Point(x,y);<br />
<br />
popup.Closed += PopupClosedEventHandler;<br />
<br />
popup.Show();<br />
now what happens internally is that the popup window is scaled using the Control.Scale()
method, since I have the AutoScale property of the popup form set to true.
This won't take effect until the call to Show() however, which means that my control
will be misplaced cause it will also scale the location of the form.
I can calculate the desired location after the call to the Show() method,
but this will first bring up the popup in the wrong location and
THEN move it, and the whole thing won't look very good...
Any ideas? I've tried to use the calculated scaleX and scaleY values to account for the
scaling done by the System, but can't quite get it right. The scale values I calculate
are the exact same the system uses, that I've concluded through testing. So I should be able
to fix it...
Can anyone help me? Or maybe give me a good briefing of how exactly the autoscale works? What I could
find out from the documentation is that the scaling should be performed in the constructor but that
is not the case from what i've found out (displaying a message before the constructor, after the constructor,
and inside an overridden scalecore() method in the popup (which is called from the Scale method)
the scale message shows up last, i.e. long after the constructor has finished.
|
|
|
|
|
Control.Scale is public - simply try calling it before performing your operations that require the scaled properties.
Microsoft MVP, Visual C#
My Articles
|
|
|
|