| 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ลองใช้ .hide กับ .show ครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-05-30 07:48:07 | By :
                            webmaster |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ไม่ทันคุณวินซะละ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-05-30 15:10:39 | By :
                            noptalent |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ถ้าเปิดฟอร์มใน MdiParent แล้วยังไม่ได้ปิดพอคลิกที่ปุ่มเปิดอีกครังมันเปิดขึ้นมาใหม่ เป็น 2 ฟอร์ม แต่หน้าเดียวกัน ต้องการให้มันเปิดหน้าเก่า ต้องทำไงครับ (vb 2008)
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-06-24 19:23:48 | By :
                            padidsam |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              |      
this.Hide();
frmMain mainFrm = new  frmMain();
//frmMain คือ form ใหม่ที่ต้องการจะเปิดจ้า
mainFrm.Show();
 
 ถ้าผิดก็ขอโทษด้วยนะ เค้าก็เด็กใหม่หัดเขียนเหมือนกันจ้า !!
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-06-24 19:46:23 | By :
                            oomi2830 |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ถ้ามีฟอร์มอยู่สองฟอร์ม ฟอร์ม 1 เวลากดไปฟอร์ม 2 form1.hide;form2.show; แบบที่พี่วินว่านะครับส่วนฟอร์ม 2 จะให้กดกลับมาก็แค่ก็อปอันเดิมมาแล้วเปลี่ยนเลข 2 เป็น1 และ 1 เป็น2 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-06-25 19:56:41 | By :
                            ฟฟ |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมขอถามต่อได้หรือเปล่าครับ 
 คือผมมือใหม่ ยัง งง ๆ อยู่
 
 กรณีผมคือ ผมเปิดฟอร์มหลักครับ แล้วใช้ menustrip เป็นเมนูในการเลือกฟอร์ม แต่อยากให้มันเปิด ฟอร์มใหม่ในพื้นที่ของฟอร์มหลัก ครับ ขอคำแนะนำครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-07-22 14:42:22 | By :
                            ตาตั้มครับ |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | กำหนด property ฟอร์มหลักเป็น MDIParent ครับ  isMdiparent = true 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-07-23 00:42:34 | By :
                            chettana |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ถามด้วยคนนะคะ 
 ถ้าเราต้องการส่งค่าจาก form1 -> form2  โดยที่ต้องการให้หน้า form1 ปิดไปอ่ะคะ  ทำไงอ่ะคะ
 
 รบกวนด้วยคะ ==
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-12-16 01:00:36 | By :
                            ochinn |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | คือถ้า ไม่ใช้ hide มีวิธีอื่นอีกไหมอ่ะคะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-12-16 01:02:59 | By :
                            ochinn |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ส่งค่าต่างฟอร์มต้องประกาศเป็น Public นะ เวลาจะใช้ตัวไหน ก็ .form นั้นเอา
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-12-16 13:16:00 | By :
                            Doremon316 |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เล่นถามกันยาวนานขนาดนั้นเชียวเหรอคับ หุหุ ตั้งแต่ 2010-05-30 จนถึง 2010-12-16
 ไม่รุว่าคุณ candy ได้คำตอบไปรึยัง จะลองวิธีผมอีกวิธีนึงก็ได้ครับ
 
 โค้ดตัวนี้ประกาศเอาไว้เรียกใช้อะครับ ถ้ามีฟอร์มโชวอยู่ให้ปิดอันเดิมฟอร์มไปก่อน
 
 Code (C#)
 
 private void CloseAllChildForm()
        {
            foreach (Form showf in this.MdiChildren)
            {
                showf.Close();
            }
        }
 ส่วนโค้ดที่เรียกใช้ฟอร์มก็
 
 Code (C#)
 
             CloseAllChildForm();
            Revenue showf = new Revenue();
            showf.MdiParent = this;
            showf.Show();
 ไม่รุว่าจะบอกช้าไปรึป่าวน้าา
  
 |  
              | 
 ประวัติการแก้ไข
 2010-12-27 09:51:45
 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-12-27 09:49:06 | By :
                            piag3026 |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              |    
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2011-06-18 19:11:23 | By :
                            c# |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              |  ขอบคุณครับ  i Love ThaiCreate.Com 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2011-06-24 10:55:09 | By :
                            คุณศุภกร |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ขอโค้ดที่เป็น vb.net ด้วยได้ไหมครับ พอดีก็ทำแบบmdi form อ่ะครับ อยากให้กดเข้า form3 แล้วปิด form2 ไปเลยอ่ะครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2011-07-14 13:15:59 | By :
                            gust |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมสงสัยอยู่อีกอย่างหนึ่งนะครับ ข้อแตกต่างระหว่าง Form1.Hide() กับ Form1.Close() นั้นแตกต่างกันอย่างไรครับ
 
 เข้าใจตามความหมายว่า
 Form1.Hide() นั้นคือซ่อนฟอร์มไว้ครับ
 Form1.Close() นั้นคือปิดฟอร์มไปเลยครับ
 
 แต่เมื่อนำมาใช้งานจริง ผมยังไม่เห็นความแตกต่างเลยครับ
 เลยอยากทราบว่ามันมีผลแตกต่างกันอย่างไรครับ?
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2011-09-07 16:01:11 | By :
                            InsitizrT |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แล้วถ้าจะกำหนด Location ให้ Mdi ลูก ทำไงครับ เช่น จะให้ Mdi ลูก อยู่ตรงกลาง Mdi หลัก อ่ะครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2012-06-10 23:25:51 | By :
                            Guest |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
 
 
 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แล้วถ้าเป็น ฟอร์มใน asp.net  ใช้คำสั่งอย่างไรครับ เพราะไม่สามารถใช้ From.show หรือ from.hide ได้ เพระฟอร์มใน asp.net จะใช้นามสกุล .aspx เช่น form1.axpx และ from2.axpx ผมมี 2 ฟอร์มครับ อยากได้คำสั่งในการเปิดสลับกันไปมาโดยใช้ command button ครับ   ขอบพระคุณมากครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2012-10-22 10:41:37 | By :
                            noon |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | การเปิดปิดฟอร์มที่เปิดไว้ภายใต้ฟอร์ม Main ให้ฟอร์มที่เปิดไว้ปิดอัตโนมัติให้ทำอย่างนี้ครับ  VB.NET สร้างซับรูทีนที่ฟอร์ม Mdi
 
 Private Sub CloseFrm()
 
 For Each TempNode In Me.MdiChildren
 TempNode.Close()
 
 Next
 End Sub
 
 
 แล้วเรียกใช้ที่ปุ่มท่ี่ต้องการเปิดฟอร์ม
 CloseFrm()  'เรียกใช้ซับรูทีนปิดฟอร์มที่เปิดไว้ทั้งหมด
 
 Dim TempNode As New frm_type_apartment '  ประกาศตัวแปร TempNode ที่ปิดฟอร์มในซับรูทีน CloseFrm  ทำหน้าที่แทนฟอร์มที่จะเปิด
 TempNode.MdiParent = Me
 TempNode.Show()  'สั่งแสดงฟอร์มที่จะเปิดครับ
 
 หวังว่าคงจะช่วยได้นะครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2017-03-26 14:00:51 | By :
                            เจษฎา สิงห์ทองชัย |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | อย่าลืมประกาศตัวแปร  อย่างนี้นะครับ Public TempNode As Form
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2017-03-26 14:46:16 | By :
                            เจษฎา สิงห์ทองชัย |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ทำไหมรันหน้าฟอร์ม2ขึ้นหน้าฟอร์ม1ตลอด 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2017-06-16 12:14:42 | By :
                            นัศรน |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ทำไมเวลาเปิด form ต้องประกาศตัวแปรด้วย   ทำไมไปเปิด form ตรงๆไปเลย 
 ทำไมต้องเขียนโค้ดแบบนี้
 Dim TempNode As New frm_type_apartment ' ประกาศตัวแปร TempNode ที่ปิดฟอร์มในซับรูทีน CloseFrm ทำหน้าที่แทนฟอร์มที่จะเปิด
 TempNode.MdiParent = Me
 TempNode.Show() 'สั่งแสดงฟอร์มที่จะเปิดครับ
 
 ทำไมไม่เขียนแบบนี้
 frm_type_apartment.MdiParent=Me
 frm_type_apartment.show()
 
 มันต่างกันยังไงครับ   เห็นหลายๆ ตัวอย่าง เวลาจะเปิด form  ต้อง  dim xxx As New  Form  ก่อน  แล้วค่อย xxx.show()
 ช่วยอภิบายหน่อยคับ (มือใหม่)
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2018-10-02 14:03:29 | By :
                            tospon |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | Code (VB.NET) Form ลูก code form_load
 
 Me.WindowState = FormWindowState.Maximized
            Me.Width = frmMain.Width
            Me.Height = frmMain.Height
 Code (VB.NET)
 
 frmClient.MdiParent = Me
frmClient.BringToFront()
frmClient.Show()
 
 ประมานนี้มั้งครับถ้าผิดก็ Sorry
 
 |  
              | 
 ประวัติการแก้ไข
 2018-10-03 08:03:10
 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2018-10-02 16:53:42 | By :
                            outhai |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แล้วแต่วัตถุประสงค์ การ clone มา ทำให้สามารถเปิด form นั้น ได้หลายๆ หน้าต่าง 
 แต่ถ้าไม่อยากเปิด หลายๆ หน้าต่าง จะใช้ form หลักเลยก็ได้
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2018-10-02 17:02:44 | By :
                            Chaidhanan |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | คือผมเชื่อมฟอร์มหลักไปฟอร์ม2 ด้วย .Hide() ; .Show() แล้วคับ แต่พอผมจะเชื่อมฟอร์ม2 ให้กับมายังฟอร์มหลักมันไม่ได้อ่ะคับ มันแสดงขึ้นมาแบบนี้คับ 
  ช่วยผมแก้หน่อยคับผม ไม่เข้าใจจริง ๆ คับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2019-01-09 16:51:28 | By :
                            ฺbeer |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เอาโค้ดส่วนที่ทำงานอื่นมาด้วยครับ มาแค่นี้ มันบอกอะไรไม่ได้ นอกจากให้อ่านเรื่อง คลาส และ การสืบทอดของคลาส ใหม่
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2019-01-09 16:57:27 | By :
                            lamaka.tor |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | นี่คับโค๊ดที่ผมเขียนคับ 
 
 
 
  
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
 namespace MemoryMatchingGame
 {
 public partial class GameWindows : Form
 {
 //Variables
 //int score = 0;//Our Scores
 Random Location = new Random();//Selects a random value from X and Y list and assign a new location to each card1
 List<Point> points = new List<Point>();//this to hole cards points
 bool again = false;//Play again or no
 PictureBox PendingImage1;//Store first flipped card into this variables
 PictureBox PendingImage2;//--------------Second-----------------------
 
 public GameWindows()
 {
 InitializeComponent();
 }
 private void GameWindows_Load(object sender, EventArgs e)
 {
 foreach (PictureBox picture in CardsHolder.Controls)
 {
 picture.Enabled = false;
 points.Add(picture.Location);
 }
 foreach (PictureBox picture in CardsHolder.Controls)
 {
 int next = Location.Next(points.Count);
 Point p = points[next];
 picture.Location = p;
 points.Remove(p);
 }
 
 timer2.Start();
 timer1.Start();
 Card1.Image = Properties.Resources.Card1;
 DupCard1.Image = Properties.Resources.Card1;
 Card2.Image = Properties.Resources.Card2;
 DupCard2.Image = Properties.Resources.Card2;
 Card3.Image = Properties.Resources.Card3;
 DupCard3.Image = Properties.Resources.Card3;
 Card4.Image = Properties.Resources.Card4;
 DupCard4.Image = Properties.Resources.Card4;
 Card5.Image = Properties.Resources.Card5;
 DupCard5.Image = Properties.Resources.Card5;
 Card6.Image = Properties.Resources.Card6;
 DupCard6.Image = Properties.Resources.Card6;
 Card7.Image = Properties.Resources.Card7;
 DupCard7.Image = Properties.Resources.Card7;
 Card8.Image = Properties.Resources.Card8;
 DupCard8.Image = Properties.Resources.Card8;
 }
 
 private void timer1_Tick(object sender, EventArgs e)
 {
 timer1.Stop();
 foreach (PictureBox picture in CardsHolder.Controls)
 {
 picture.Enabled = true;
 picture.Cursor = Cursors.Hand;
 picture.Image = Properties.Resources.Cover;
 }
 }
 
 private void timer2_Tick(object sender, EventArgs e)
 {
 int timer = Convert.ToInt32(label1.Text);
 timer = timer-1;
 label1.Text = Convert.ToString(timer);
 if (timer == 0)
 {
 timer2.Stop();
 }
 }
 //การ์ดเปลี่ยน
 #region Cards
 private void Card1_Click(object sender, EventArgs e)
 {
 Card1.Image = Properties.Resources.Card1;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card1;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card1;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card1.Enabled = false;
 DupCard1.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 10);
 timer3.Start();
 }
 
 }
 }
 
 private void DupCard1_Click(object sender, EventArgs e)
 {
 DupCard1.Image = Properties.Resources.Card1;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard1;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard1;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card1.Enabled = false;
 DupCard1.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 10);
 timer3.Start();
 }
 
 }
 }
 
 private void Card2_Click(object sender, EventArgs e)
 {
 Card2.Image = Properties.Resources.Card2;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card2;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card2;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card2.Enabled = false;
 DupCard2.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard2_Click(object sender, EventArgs e)
 {
 DupCard2.Image = Properties.Resources.Card2;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard2;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard2;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card2.Enabled = false;
 DupCard2.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 
 }
 }
 
 private void Card3_Click(object sender, EventArgs e)
 {
 Card3.Image = Properties.Resources.Card3;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card3;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card3;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card3.Enabled = false;
 DupCard3.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard3_Click(object sender, EventArgs e)
 {
 DupCard3.Image = Properties.Resources.Card3;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard3;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard3;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card3.Enabled = false;
 DupCard3.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void Card4_Click(object sender, EventArgs e)
 {
 Card4.Image = Properties.Resources.Card4;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card4;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card4;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card4.Enabled = false;
 DupCard4.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard4_Click(object sender, EventArgs e)
 {
 DupCard4.Image = Properties.Resources.Card4;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard4;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard4;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card4.Enabled = false;
 DupCard4.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void Card5_Click(object sender, EventArgs e)
 {
 Card5.Image = Properties.Resources.Card5;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card5;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card5;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card5.Enabled = false;
 DupCard5.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard5_Click(object sender, EventArgs e)
 {
 DupCard5.Image = Properties.Resources.Card5;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard5;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard5;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card5.Enabled = false;
 DupCard5.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void Card6_Click(object sender, EventArgs e)
 {
 Card6.Image = Properties.Resources.Card6; if (PendingImage1 == null)
 {
 PendingImage1 = Card6;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card6;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card6.Enabled = false;
 DupCard6.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 
 }
 
 private void DupCard6_Click(object sender, EventArgs e)
 {
 DupCard6.Image = Properties.Resources.Card6;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard6;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard6;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card6.Enabled = false;
 DupCard6.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void Card7_Click(object sender, EventArgs e)
 {
 Card7.Image = Properties.Resources.Card7;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card7;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card7;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card7.Enabled = false;
 DupCard7.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard7_Click(object sender, EventArgs e)
 {
 DupCard7.Image = Properties.Resources.Card7;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard7;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard7;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card7.Enabled = false;
 DupCard7.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void Card8_Click(object sender, EventArgs e)
 {
 Card8.Image = Properties.Resources.Card8;
 if (PendingImage1 == null)
 {
 PendingImage1 = Card8;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = Card8;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card8.Enabled = false;
 DupCard8.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 
 private void DupCard8_Click(object sender, EventArgs e)
 {
 DupCard8.Image = Properties.Resources.Card8;
 if (PendingImage1 == null)
 {
 PendingImage1 = DupCard8;
 }
 else if (PendingImage1 != null && PendingImage2 == null)
 {
 PendingImage2 = DupCard8;
 }
 if (PendingImage1 != null && PendingImage2 != null)
 {
 if (PendingImage1.Tag == PendingImage2.Tag)
 {
 PendingImage1 = null;
 PendingImage2 = null;
 Card8.Enabled = false;
 DupCard8.Enabled = false;
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) + 10);
 }
 else
 {
 ScoreCounter.Text = Convert.ToString(Convert.ToInt32(ScoreCounter.Text) - 5);
 timer3.Start();
 }
 }
 }
 #endregion
 
 private void timer3_Tick(object sender, EventArgs e)
 {
 timer3.Stop();
 PendingImage1.Image = Properties.Resources.Cover;
 PendingImage2.Image = Properties.Resources.Cover;
 PendingImage1 = null;
 PendingImage2 = null;
 }
 
 private void button2_Click(object sender, EventArgs e)
 {
 this.Hide();
 Home home = new Home();
 home.Show();
 }
 
 private void button1_Click(object sender, EventArgs e)
 {
 this.Hide();
 GameWindows game = new GameWindows();
 game.Show();
 
 }
 }
 }
 
 นี่คือโค๊ดfrom 2 ทั้งหมดคับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2019-01-09 23:50:17 | By :
                            ฺbeer |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมใช้ VB6 รุ่นเก่า  ปัญหาคือ ผมมี 2 form , f1 มี text1.text ส่วนF2 มีปุ่มbuttom1, เมื่อเรากดปุ่มที่ F2 แล้วคำว่า YES ไปแสดงที่ช่อง text1.text ต้องใช้คำสั่งอย่างไรครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2019-01-25 14:02:51 | By :
                            am |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ลองใช้ delegate ดูครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2019-01-25 14:57:46 | By :
                            Da_che |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |