'Common Mobile/WinCE Mobile'에 해당되는 글 3건

  1. 2009.07.03 [Mobile] 화면 회전시 Loding 화면 구현 MV6.0
  2. 2009.06.04 WM6.0 자동 네트워크 접속
  3. 2009.05.28 Mobile 5.0 Screen 화면 전환
1. 메인 화면
2. 기능 수행 화면
3. 메인에서 기능 수행 화면 회전시 보기 안좋은 화면 가리기용 Loding 화면

이 필요합니다.(TEST 환경)

main

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms;

namespace Motion
{
    public partial class Form1 : Form
    {
        public Form1()
        { 

            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            LoadForm90 lform = new LoadForm90();
            lform.Show();
            lform.Refresh();
           
            SystemSettings.ScreenOrientation = ScreenOrientation.Angle90;

            subForm subform = new subForm(lform);
            subform.ShowDialog();
            subform.Close();
            subform = null;
           
            LoadForm0 lform2 = new LoadForm0();
            lform2.Show();
            lform2.Refresh();

            SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
           
            lform2.Close();
            lform2.Dispose();
            lform2 = null;
            GC.Collect();
        }
    }
}


Load form 들은 생성자에만 아래와 같이 구현
 public LoadForm90()
 {
    InitializeComponent();
    this.Refresh();
    Application.DoEvents();
 }

subForm

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Motion
{
    public partial class subForm : Form
    {
        LoadForm90 sform;
        public subForm(LoadForm90 sforms)
        {
            sform = sforms;
            InitializeComponent();
        }

        private void subForm_Load(object sender, EventArgs e)
        {
            if (sform != null)
            {
                sform.Close();
                sform.Dispose();
                sform = null;
            }
        }
    }
}



버튼을 클릭하면 우선 노란색으로 변한뒤에 화면이 회전한다

그 후에 노란색 화면이 사라지면서 내용이 보여진다
Posted by penguindori
Story : 이거 땜에 스트레스 받아서 환장 했다. ㅎ-ㅎ-ㅎ-ㅎ-;;

 인터넷 접속을 통한 자동 접속 방법 1 [using System.Net;]
           
            WebRequest webreq;
            WebResponse webres;
            string url = "http://www.msn.com";

            webreq = System.Net.WebRequest.Create(url);

            bool success = false;
            try
            {
                webres = webreq.GetResponse();
                webreq.Abort();
                success = true;
            }
            catch(Exception er) {}


그리고 요청 사항이였던 이넘 ;;

OpenNETCF <-- 설치해야 한다.
http://opennetcf.com/ 에서 다운 받으면 됨

        private void typeConnection(string typeName)
        { 
            DestinationInfoCollection DIC = connMgr.EnumDestinations();
            try
            {
                foreach (DestinationInfo di in DIC)
                {
                    if (di.Description == "The Internet") // (di.Description == typeName)
                    {
                        connMgr.Connect(di.Guid, true, ConnectionMode.Asynchronous);
                    }
                }
            }
            catch (Exception er)
            {
                MessageBox.Show(er.ToString());
            }
       }

            AdapterCollection adapters = Networking.GetAdapters();

            foreach (Adapter adapter in adapters)
            {
                int ras = adapter.Name.IndexOf("RAS VPN");
                int activeSync = adapter.Name.IndexOf("Serial on USB");
                // Check if this is a GPRS/GSM/CDMA adapter
                if ((ras == -1) && (activeSync == -1) && (adapter.Type == AdapterType.PPP) && (!adapter.IsWireless))
                {
                    GPRSIPAddress = adapter.CurrentIpAddress;
                }

                ConnectionManager connMgr = new ConnectionManager();
                DestinationInfoCollection destInfoColl = connMgr.EnumDestinations();

                bool connected = false;
                foreach (DestinationInfo destInfo in destInfoColl)
                {
                    if (destInfo.Description == "Gprs connection")
                    {
                        connMgr.Connect(destInfo.Guid, true, ConnectionMode.Asynchronous);
                        while (!connected)
                        {
                            if (connMgr.Status != ConnectionStatus.Connected)
                            {
                                System.Threading.Thread.Sleep(1000);
                                continue;
                            }
                            connected = true;
                        }
                        break;
                    }
                }


            }
        }

피곤해서 색깔은 다음에 칠하자 ㅡㅡ;






Posted by penguindori
Common Mobile/WinCE Mobile2009. 5. 28. 11:04
1. 관련 소스

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsCE.Forms; //SystemSettings NameSpace

namespace Screen2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           textBox1.Text = "화면 방향 :" + SystemSettings.ScreenOrientation.ToString();
            textBox2.Text = "화면 해상도" + Screen.PrimaryScreen.Bounds.Width + "x" +
                                   Screen.PrimaryScreen.Bounds.Height;
            if (SystemSettings.ScreenOrientation == ScreenOrientation.Angle90)
            {
                SystemSettings.ScreenOrientation = ScreenOrientation.Angle0;
            }
            else
            {
                SystemSettings.ScreenOrientation = ScreenOrientation.Angle90;
            }
        }
    }
}


2. UI 관련

0. Base : Panel
    => 기본적으로 폼 위에 Panel을 올리고 속성에서 Dock : Fill
1. 화면 전환 : Button
    => 속성에서 Dock : Top 

2. textBox1 : 화면 각도 표시
    => 속성에서 Dock : Top 

3. 하나,둘... : Grid
    => 속성에서 Dock : Top 

4. textBox2 : 해상도 표시
    => 속성에서 Dock : Bottom

=> Result
http://windowsmobile7.tistory.com/5 [참조]
Posted by penguindori