Questions about Smartphone's programming

Hello, I am a novice at this and I have some basic questions (may be quite silly).

Well:

  • How many ways of building a new window/view are there in Windows Mobile 2005

I tried to do it creating a new Form and make

Application.Run(new Form2());

where Form2 is the new created view. The trouble comes when, at the exit of Form2, the system shows an error:

"An unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

Additional information: ArgumentException"

  • Which are the tasks of Form2.cs and Form2.Designer.cs files

I think that Form2.Designer.cs is the one who build the view, and the other one makes the main tasks.

  • When VS 2005 deploys the application in the emulator it runs automatically. But if I exit from my application, how can I run it again

Which will be the behavior when this is a real Smartphone

I'm sorry if I was very boring, but if anyone of you could help I would be very pleased.

Thanks in advance.

Alvaro




Answer this question

Questions about Smartphone's programming

  • JimDuncan

    Alvaro Penarrubia wrote:

    Hello, again.

    It wasn't a silly question (at least for me). I had the reference of System.Windows.Forms. There is also Microsoft.WindowsMobile.Forms, but not System.WindowsMobile.Forms as you said. But I think you refers to one of these.

    Anyway I have solved my problems. Thank you.

    But... can you tell me something about the other topics...

    Thanks,

    Alvaro

    yep, sorry, been a while since I've worked in the CompactFramework, as you figured out, it's Microsoft.WindowsMobile.etc.

    the other questions:

    yes, the designer generates/controls the view. the [name].cs file is intended more for functional code, wiring up your form to the classes/objects you're employing.

    if you into the solution's build properties, you should find a build path. this is where VS2005 will deploy the solution on the device. you can go to this path and click the executable it creates there to run the application outside of the development environment.


  • ntsoo

    You can only use Application.Run() one time. To show another form do this:

    Form anotherForm = new Form2();

    anotherForm.Show(); // You will have two forms at once. Close/Hide first form as needed.

    or

    anotherForm.ShowDialog(); // Modal form - current form blocked until anotherForm exits.



  • Charger

    Alvaro Penarrubia wrote:

    Hi, thanks, but the problems still remains.

    When I type the point and the VS shows the available methods, neither ShowDialog() nor Show() appear. If I look up in the Help I can read a note telling that ShowDialog() is a method available only in the Framework 2 but in the ShowDialog() item there is nothing like this.
    Then I went to the "About...". It shows "Microsoft .NET Framework Version 2.0.50727".

    So, which can be the problem I created the project as "Device Application for Windows Mobile 5.0 Smartphone"

    (Something about the other questions )


    Thanks for your help.

    Alvaro

    Maybe a silly question, but do you have System.WindowsMobile.Forms referenced


  • Raja Pratap

    Hi, thanks, but the problems still remains.

    When I type the point and the VS shows the available methods, neither ShowDialog() nor Show() appear. If I look up in the Help I can read a note telling that ShowDialog() is a method available only in the Framework 2 but in the ShowDialog() item there is nothing like this.
    Then I went to the "About...". It shows "Microsoft .NET Framework Version 2.0.50727".

    So, which can be the problem I created the project as "Device Application for Windows Mobile 5.0 Smartphone"

    (Something about the other questions )


    Thanks for your help.

    Alvaro



  • ctusch

    Hello, again.

    It wasn't a silly question (at least for me). I had the reference of System.Windows.Forms. There is also Microsoft.WindowsMobile.Forms, but not System.WindowsMobile.Forms as you said. But I think you refers to one of these.

    Anyway I have solved my problems. Thank you.

    But... can you tell me something about the other topics...

    Thanks,

    Alvaro



  • Nagaraj K

    Thanks once again.


  • JD Moore

    Well... two things more:

    • Now that I could open the form. How can I return to the main window

    • Is Form the right way to manage windows/views

    • Third and much more important: Where can I find information (samples, guides,...) about this kind of beginner's topics In this way I think it isn't necessary to be disturbing you.

    Thanks

    Alvaro



  • wadnerk

    Alvaro Penarrubia wrote:

    Well... two things more:

    • Now that I could open the form. How can I return to the main window

    • Is Form the right way to manage windows/views

    • Third and much more important: Where can I find information (samples, guides,...) about this kind of beginner's topics In this way I think it isn't necessary to be disturbing you.

    Thanks

    Alvaro

    1. [mainformname].Show()

    2. yes -- a Form is .Net terminology for the "window" you're working with.

    3. MSDN has a .Net Compact Framework FAQ: http://msdn2.microsoft.com/en-us/netframework/aa497275.aspx

    GotDotNet also has a QuickStart: http://samples.gotdotnet.com/quickstart/CompactFramework/


  • Questions about Smartphone's programming