VS.NET needs to pay attention to the CE program:
1, FORM display problem. Since it runs on the CE, it is not only a lot of things, but also there are some problems not on Winform because of excessive simplification. These issues are the easiest to confuse the CF. How many forms make normal display and hide. In WinForm, Form1.show () can display Form1, but it is different below in CF. In CF, this code will make your program "disappear": // this = form1 form2 f2 = new form2 (); this.hide (); f2.show (); so simple code, you might It is considered that a F2 should be displayed, but in fact, there is a system desktop or another unrelated program interface. Take a closer study, I found that as long as your program goes to the background, you can't display any windows in your program (except for the API), because this show is only changed in the cf. The step of "visual state" without resetting the program focus. And the code snippet first hides himself. This time all interfaces in your program have been hidden, so the focus is naturally not on this program, and the back F2.SHOW has not taken the focus, so it is still not displayed come out. So how is it half? Through the API? It is ok, but this is more troublesome: In addition to writing API statements, you have to call this API at each call show. In fact, the API does not exist I have not studied, maybe I send one message to the window. In fact, it is not difficult to solve this problem. The key is to avoid the loss of focus. If you want the code above, it should be changed to this: // this = Form1 Form2 F2 = new form2 (); f2.show (); this. Hide (); It should be noted that this problem exists in the window of ShowDialog, such as: // this = form1 form2 f2 = new form2 (); f2.showdialog (); this.show ();
// this = form2, f1 = form1 private void form2_load (...) {f1.hide (); .Hide (); this.show (); The method of processing can only be displayed before the F2 hidden, such as: // this = form1 form2 f2 = new form2 (); f2.showdialog ();
// this = form2, f1 = form1 private void form2_load (...) {f1.hide ();} private void form2_closing (...) {f1.show ();} private void buttonok_click (...) { F1.show (); this.Showdialog = DialogResult.ok; this.hide ();} 2, Form's appearance problem: Form's appearance control is another problem with which is very confusing for the initial contact. The appearance control here is how to control only a small window, how to complete the screen, how to click immediately to turn off immediately instead of hidden, etc. The small window refers to the display mode that only occupies a portion of the screen as part of Winform rather than all. The method is to adjust the FormBordersTyle to None, which means that there is no title bar, which is not possible to move. If you want to have a title bar, you can move it, it seems that you can only be implemented. Full screen refers to even the title bar does not want, the implementation method is: 1. Turn off SIP 2. Set the Menu of Form to Null 3. Set the Form's WindowsTate to Maximize. Note that this must be After it is displayed, it can be valid. Click on the upper right corner to close instead of hidden this relatively simple, just set Minimizebox to false.
3. SIP problem SIP is the input board, such as what is pinyin, what is written by the full screen. This thing is very annoying, and the entire development will continue to appear with her related questions. Summarizing, mainly need to pay attention to the following aspects: 1, SIP seems to be globally, the Form1 code will be SIP.Enabled = false, then the form2 code will be SIP.Enabled = true, this time shows Form1, you don't want I thought that the SIP did not display it, it is actually displayed. So many times there will be such a problem: The window you show is closed, but some users have a touch of this window, and this code touches another hidden window, but this code will SIP is open. So you will be very depressed when you debug: My code is clearly opened, is it to open it automatically? When adjusting, it is easy to ignore those "unrelated" code, and it is difficult to debug. 2, SIP and MainMenu are associated. If a Form does not set the MENU attribute as a valid value, then an exception will be thrown once you call SIP.Enabled = True. A relatively easy because there is no attention to the situation, if you want to complete the window, then you must remove the menu, if this is sometimes sip.enabled = true ... 3, SIP does not automatically judge the search of FORM Whether it has been abandoned (Disposed). At the same time, due to the form of Form, it is not immediately, even simply does not call Dispose (), so that the SIP is not DISPOSE in the Form actually disposed, and even the events associated with this SIP will not be released. Below is an error example:
// this = form1 form2 f2 = new form2 (); f2.close (); SIP.Enabled = true; SIP.Enabled = false; // this = form2 ... void initializecomponents () {... SIP.EnableDChanged = new system.eventhandler (SIP_ENABLEDCHANGED); ...} ... void Sip_enabledchanged (...) {this.visible = true; // Throw an exception here, because F2 is already closed. }
I will answer the questions of each person now:
Q: What software is developed on the PDA? A: At present, it seems that some industry software and the application on mobile phones, which may have more attention to the latter. For example, wireless transmission, GSM, GPRS, CDMA GPS GIS, see how other service things, such as weather forecast, hotel ticket price query, etc. I personally have some views and Bisslot (Mumu), the web way. However, from now, the PDA is relatively slow, and if you want to do it, you must even do it for the for PPC.
Q: Where is the simulator? I am quite interested, but I don't know where to start A: Simulator vs.net 2003 comes with. You can do new SMARTDEVICE solution, you will see an option (drop-down box) like "PocketPC Simulator", which can be selected, and there is also a PocketPC device. However, this comes with a PPC 2002 simulator, PPC2003 (including smartphone) simulator addition package can be found in Microsoft website. However, even if you don't pretend, you can develop PPC2003 software, because .NET CF is itself a platform-independent-including CPU platform and WinCE version. The procedure written will be able to run on the machine installed with .NET CF, you can go directly to COPY, it is not necessarily to install the program. Currently supported .NET CF includes PPC2000 / PPC2002 / PPC2003 / Wince.NET 4.0 / 4.1 / 4.2, but only PPC2003 / Wince 4.2 is comes with .NET CF, others must be installed. From this aspect, VS.NET development is developed with EVC, which is strong, and does not need to compile different versions for different CPUs. As for why, now, now I will write something to say, practice!
Q: Developed with VS.NET is very cool, such as developing speeds, such as achieving some interesting programming methods, such as can be able to install it to other machines, even if you can do it I know how this is what I have made, I can't do it. What do you mean? Isn't it universal on the same type of machine? I saw something like you wrote, I wanted to do Wince's development, I also use VS.NET A: No, I mean can do this, I don't have to do this, and do this need a certain skill. The system itself does not have such a function. In fact, if you don't specifically do something, it is not only universal, but also different CPUs, different versions of WinCE systems, as long as they are installed (or bring) .NET CF, they can run, directly COPY Yes! Is it very convenient? However, the problem is also coming, just Copy can be used, then don't you just have the same as the PC? Isn't it easy to piracy? What I want to tell you is this: In the PPC development, it is entirely possible to prevent piracy. You can do this machine only on this machine, and even say that this machine is installed. Things are only available in this machine. But how can I do, I don't dare to say, confidentiality, how is the Q: .NET program in the CE operation? A: The speed does not have the ratio of EVC, and the size seems to be a bit. However, if you plan to use .NET CF, you must pay attention to optimization. Is there any optimization really bad! (It feels a bit like returning to the DOS era. At that time, the speed is the first consideration!) How to optimize the opportunity to have the opportunity to speak.
Q: Can you introduce a salary situation in the company to develop PDAs in the company A: If you are a boss, what do you think? Ha ha! Now, the salary is going to watch whether the product is selling well ... It seems that it seems to be smooth, but the money has not yet arrived ...
It is reasonable to run very well on the PC, but it is reasonable to exit immediately after running after the WIN CE target. Compact Framework already included in my WIN CE Image file
Run the .NET CF program on WIN CE, you need to install .NET cfvs.net first on the PDA will first determine if there is no .NET CF on the PDA, no words will be installed first. It's time to debug it, it will be some.
There is no Win32 class under CE, so you can't all Win32 features, including the API, so the handle is not necessary because it doesn't need to perform handle operations.
How to copy the file to the Wince .NET emulator I try it according to the MSDN example "ms-help: //ms.msdnqtr.2003feb.2052/dv_evtuv/html/ettskcopyingfilestotargetDevice.htm", but in the second step Sharing "icon, unable to do