示例#1
0
        private void mainPrint()
        {
            Drawclass dc = new Drawclass();

            Lbclass lb1 = new Lbclass(this, "lb_day", "일일", 200, 40, 10, 200);
            Lbclass lb2 = new Lbclass(this, "lb_hour", "시간별", 200, 40, 10, 300);

            //form.Controls.Add(dc.lb1(lb1));
            //form.Controls.Add(dc.lb1(lb2));
        }
示例#2
0
        public Label lb2(Lbclass lb, float tSize)
        {
            Label label = new Label();

            label.Name      = lb.Name;
            label.Text      = lb.Text;
            label.Size      = new Size(lb.SX, lb.SY);
            label.Location  = new Point(lb.PX, lb.PY);
            label.Font      = new Font(FontFamily.GenericSansSerif, tSize, FontStyle.Bold);
            label.ForeColor = Color.WhiteSmoke;
            label.BackColor = Color.Transparent;
            return(label);
        }
示例#3
0
        public Label lb(Lbclass lb)
        {
            Label label = new Label();

            label.Name      = lb.Name;
            label.Text      = lb.Text;
            label.Size      = new Size(lb.SX, lb.SY);
            label.Location  = new Point(lb.PX, lb.PY);
            label.BackColor = Color.Transparent;
            lb.Form.Controls.Add(label);

            return(label);
        }
示例#4
0
        private void MainPan(int sX, int sY, int pX, int pY)
        {
            panel1 = new Panel();

            panel1.Location = new Point(pX, pY);
            panel1.Size     = new Size(sX, sY);
            panel1.BackgroundImageLayout = ImageLayout.Stretch;
            //panel1.BackgroundImage = (Bitmap)WindowsFormsHiWeather.Properties.Resources.background;
            panel1.BackgroundImage = (Bitmap)WindowsFormsHiWeather.Properties.Resources.background1;

            PictureBox weather = new PictureBox();
            PictureBox picture = new PictureBox();

            TextBox tb = new TextBox();

            tb.Size     = new Size(120, 50);
            tb.Location = new Point(800, 50);

            tb.ResumeLayout(false);
            tb.PerformLayout();

            ResumeLayout(false);
            PerformLayout();

            Lbclass adlb   = new Lbclass(this, "adlb", ((Weather)weatherlist[0]).Place + ", " + ((Weather)weatherlist[0]).City, 300, 25, 370, 0);                                                                       // 주소 라벨
            Lbclass dglb   = new Lbclass(this, "dglb", days[0].Toptemperature + "˚C  " + days[0].Toptemperature.ToString() + "/" + days[0].Bottomtemperature.ToString() + " \n" + days[0].Condition, 110, 50, 400, 40); // 기상 라벨
            Lbclass timelb = new Lbclass(this, "timelb", "마지막 업데이트: " + DateTime.Now.ToString("HH") + ":" + DateTime.Now.ToString("mm") + ":" + DateTime.Now.ToString("ss"), 200, 20, 350, 100);

            Btnclass sbtn  = new Btnclass(this, "sbtn", "검색", 30, 40, 920, 41, btn5_Click);
            Btnclass rfbtn = new Btnclass(this, "rfbtn", "새로고침", 50, 45, 800, 0, btn5_Click);
            //Btnclass bmbtn = new Btnclass(this, "bmbtn", "즐찾추가", 50, 45, 850, 0, btn5_Click);
            Btnclass bmbtn;

            if (((Weather)weatherlist[0]).Book)
            {
                bmbtn = new Btnclass(this, "bmbtn2", "즐찾추가", 50, 45, 850, 0, btn5_Click);
            }
            else
            {
                bmbtn = new Btnclass(this, "bmbtn", "즐찾추가", 50, 45, 850, 0, btn5_Click);
            }

            weather.Image     = (Bitmap)Properties.Resources.ResourceManager.GetObject("sunny");
            weather.SizeMode  = PictureBoxSizeMode.StretchImage;
            weather.Location  = new Point(330, 30);
            weather.Size      = new Size(70, 65);
            weather.BackColor = Color.Transparent;

            picture.Image     = (Bitmap)Properties.Resources.ResourceManager.GetObject("dust2");
            picture.SizeMode  = PictureBoxSizeMode.StretchImage;
            picture.Location  = new Point(510, 30);
            picture.Size      = new Size(70, 65);
            picture.BackColor = Color.Transparent;

            Lbclass lb = new Lbclass(this, "lb", "시간별", 100, 30, 10, 120);

            for (int i = 0; i < ((Weather)weatherlist[0]).Conditions_hour.Length; i++)
            {
                Lbclass    hour_lb      = new Lbclass(this, "hour_lb", ((Weather)weatherlist[0]).Conditions_hour[i].Hour.ToString() + "시", 50, 20, 25 + (i * 120), 160);
                Lbclass    tmp_lb       = new Lbclass(this, "tmp_lb", ((Weather)weatherlist[0]).Conditions_hour[i].Temperature.ToString() + "˚C", 70, 20, 15 + (i * 120), 220);
                Lbclass    con_lb       = new Lbclass(this, "con_lb", ((Weather)weatherlist[0]).Conditions_hour[i].Condition, 100, 40, 15 + (i * 120), 240);
                PictureBox picture_con  = new PictureBox();
                PictureBox picture_dust = new PictureBox();

                picture_con.Image      = (Bitmap)WindowsFormsHiWeather.Properties.Resources.sunny;
                picture_con.SizeMode   = PictureBoxSizeMode.StretchImage;
                picture_con.ClientSize = new Size(40, 40);
                picture_con.Location   = new Point(10 + (i * 120), 180);
                picture_con.BackColor  = Color.Transparent;

                picture_dust.Image      = (Bitmap)WindowsFormsHiWeather.Properties.Resources.dust2;
                picture_dust.SizeMode   = PictureBoxSizeMode.StretchImage;
                picture_dust.ClientSize = new Size(40, 40);
                picture_dust.Location   = new Point(50 + (i * 120), 180);
                picture_dust.BackColor  = Color.Transparent;

                panel1.Controls.Add(dc.lb1(tmp_lb, 15));
                panel1.Controls.Add(dc.lb1(con_lb, 12));
                panel1.Controls.Add(dc.lb1(hour_lb, 12));
                panel1.Controls.Add(picture_con);
                panel1.Controls.Add(picture_dust);
            }
            panel1.Controls.Add(dc.lb2(lb, 18));
            Lbclass lb_day = new Lbclass(this, "lb_day", "일별", 100, 30, 10, 280);

            for (int i = 0; i < days.Length; i++)
            {
                PictureBox wticon   = new PictureBox();
                PictureBox dusticon = new PictureBox();
                Lbclass    addrlb   = new Lbclass(this, "addrlb", days[i].Day.ToString() + "일", 80, 20, 30 + i * 140, 320);                                                                            // 주소 라벨
                Lbclass    dgrlb    = new Lbclass(this, "dgrlb", "최고 : " + days[i].Toptemperature + "˚C  " + "\n최저 : " + days[i].Bottomtemperature.ToString() + "˚C  ", 100, 40, 15 + (i * 140), 390); // 기상 라벨
                Lbclass    cdlb     = new Lbclass(this, "cdlb", days[i].Condition, 100, 40, (15 + i * 140), 430);

                dusticon.Image      = (Bitmap)Properties.Resources.ResourceManager.GetObject("dust1");
                dusticon.SizeMode   = PictureBoxSizeMode.StretchImage;
                dusticon.Location   = new Point(55 + (i * 140), 350);
                dusticon.ClientSize = new Size(40, 40);
                dusticon.BackColor  = Color.Transparent;

                wticon.Image      = (Bitmap)Properties.Resources.ResourceManager.GetObject("sunny");
                wticon.SizeMode   = PictureBoxSizeMode.StretchImage;
                wticon.Location   = new Point(15 + (i * 140), 350);
                wticon.ClientSize = new Size(40, 40);
                wticon.BackColor  = Color.Transparent;

                panel1.Controls.Add(dc.lb1(addrlb, 15));
                panel1.Controls.Add(dc.lb1(dgrlb, 12));
                panel1.Controls.Add(dc.lb1(cdlb, 12));
                panel1.Controls.Add(wticon);
                panel1.Controls.Add(dusticon);
            }
            panel1.Controls.Add(dc.lb2(lb_day, 18));

            panel1.Controls.Add(dc.lb1(adlb, 18));
            panel1.Controls.Add(dc.lb1(dglb, 13));
            panel1.Controls.Add(dc.btn1(sbtn));
            panel1.Controls.Add(dc.btn1(rfbtn));
            panel1.Controls.Add(dc.btn1(bmbtn));
            panel1.Controls.Add(tb);
            panel1.Controls.Add(weather);
            panel1.Controls.Add(picture);
            panel1.Controls.Add(dc.lb1(timelb, 10));

            Controls.Add(panel1);
        }