Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > .NET Framework > Forum > กดปุ่ม เปิด form ใหม่ แล้วให้ form เก่าหายไปทำยังไงค่ะ คือเวลาเรียกหน้าใหม่ หน้าเก่าก็ยังคงอยู่ มันเยอะมากเลยอ่าค่ะ



 

กดปุ่ม เปิด form ใหม่ แล้วให้ form เก่าหายไปทำยังไงค่ะ คือเวลาเรียกหน้าใหม่ หน้าเก่าก็ยังคงอยู่ มันเยอะมากเลยอ่าค่ะ

 



Topic : 043449



โพสกระทู้ ( 65 )
บทความ ( 0 )



สถานะออฟไลน์




คือเวลาเรียกหน้าใหม่ หน้าเก่าก็ยังคงอยู่ มันเยอะมากเลยอ่าค่ะ เลยอยากจะให้เรียกหน้าใหม่ขึ้นมาหน้าเก่าก็จะหายไป
ใช้ c# อ่าค่ะ



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-05-30 03:14:36 By : pinkladyz View : 49794 Reply : 33
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ลองใช้ .hide กับ .show ครับ






Date : 2010-05-30 07:48:07 By : webmaster
 


 

No. 2



โพสกระทู้ ( 145 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ไม่ทันคุณวินซะละ
Date : 2010-05-30 15:10:39 By : noptalent
 

 

No. 3



โพสกระทู้ ( 1 )
บทความ ( 0 )



สถานะออฟไลน์


ถ้าเปิดฟอร์มใน MdiParent แล้วยังไม่ได้ปิดพอคลิกที่ปุ่มเปิดอีกครังมันเปิดขึ้นมาใหม่ เป็น 2 ฟอร์ม แต่หน้าเดียวกัน
ต้องการให้มันเปิดหน้าเก่า ต้องทำไงครับ (vb 2008)
Date : 2010-06-24 19:23:48 By : padidsam
 


 

No. 4



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


     
this.Hide();
frmMain mainFrm = new  frmMain();
//frmMain คือ form ใหม่ที่ต้องการจะเปิดจ้า
mainFrm.Show();


ถ้าผิดก็ขอโทษด้วยนะ เค้าก็เด็กใหม่หัดเขียนเหมือนกันจ้า !!
Date : 2010-06-24 19:46:23 By : oomi2830
 


 

No. 5

Guest


ถ้ามีฟอร์มอยู่สองฟอร์ม ฟอร์ม 1 เวลากดไปฟอร์ม 2 form1.hide;form2.show; แบบที่พี่วินว่านะครับส่วนฟอร์ม 2 จะให้กดกลับมาก็แค่ก็อปอันเดิมมาแล้วเปลี่ยนเลข 2 เป็น1 และ 1 เป็น2
Date : 2010-06-25 19:56:41 By : ฟฟ
 


 

No. 6

Guest


ผมขอถามต่อได้หรือเปล่าครับ

คือผมมือใหม่ ยัง งง ๆ อยู่

กรณีผมคือ ผมเปิดฟอร์มหลักครับ แล้วใช้ menustrip เป็นเมนูในการเลือกฟอร์ม แต่อยากให้มันเปิด ฟอร์มใหม่ในพื้นที่ของฟอร์มหลัก ครับ ขอคำแนะนำครับ
Date : 2010-07-22 14:42:22 By : ตาตั้มครับ
 


 

No. 7

Guest


กำหนด property ฟอร์มหลักเป็น MDIParent ครับ isMdiparent = true
Date : 2010-07-23 00:42:34 By : chettana
 


 

No. 8

Guest


ถามด้วยคนนะคะ

ถ้าเราต้องการส่งค่าจาก form1 -> form2 โดยที่ต้องการให้หน้า form1 ปิดไปอ่ะคะ ทำไงอ่ะคะ

รบกวนด้วยคะ ==
Date : 2010-12-16 01:00:36 By : ochinn
 


 

No. 9

Guest


คือถ้า ไม่ใช้ hide มีวิธีอื่นอีกไหมอ่ะคะ
Date : 2010-12-16 01:02:59 By : ochinn
 


 

No. 10



โพสกระทู้ ( 56 )
บทความ ( 0 )



สถานะออฟไลน์


ส่งค่าต่างฟอร์มต้องประกาศเป็น Public นะ
เวลาจะใช้ตัวไหน ก็ .form นั้นเอา
Date : 2010-12-16 13:16:00 By : Doremon316
 


 

No. 11



โพสกระทู้ ( 50 )
บทความ ( 0 )



สถานะออฟไลน์


เล่นถามกันยาวนานขนาดนั้นเชียวเหรอคับ หุหุ
ตั้งแต่ 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
 


 

No. 12

Guest



Date : 2011-06-18 19:11:23 By : c#
 


 

No. 13

Guest


ขอบคุณครับ i Love ThaiCreate.Com
Date : 2011-06-24 10:55:09 By : คุณศุภกร
 


 

No. 14

Guest


ขอโค้ดที่เป็น vb.net ด้วยได้ไหมครับ พอดีก็ทำแบบmdi form อ่ะครับ อยากให้กดเข้า form3 แล้วปิด form2 ไปเลยอ่ะครับ
Date : 2011-07-14 13:15:59 By : gust
 


 

No. 15

Guest


ผมสงสัยอยู่อีกอย่างหนึ่งนะครับ
ข้อแตกต่างระหว่าง Form1.Hide() กับ Form1.Close() นั้นแตกต่างกันอย่างไรครับ

เข้าใจตามความหมายว่า
Form1.Hide() นั้นคือซ่อนฟอร์มไว้ครับ
Form1.Close() นั้นคือปิดฟอร์มไปเลยครับ

แต่เมื่อนำมาใช้งานจริง ผมยังไม่เห็นความแตกต่างเลยครับ
เลยอยากทราบว่ามันมีผลแตกต่างกันอย่างไรครับ?
Date : 2011-09-07 16:01:11 By : InsitizrT
 


 

No. 16

Guest


ของผมโค๊ต VB.Net นะครับ
เปิดฟอร์ม
Open form
Form1.Show()


ซ่อนฟอร์ม
Hide form
Form1.Hide()


ปิดฟอร์ม
Close form
Form1.Close()


ต้องการให้เปิดปิดฟอร์มอยู่ในฟอร์มหลัก
รูปแบบ ฟอร์มลูก.MdiParent = ฟอร์มหลัก (เซตไว้ใน Load ของฟอร์มลูก)
Set mdiparent form
Form2.MdiParent = Form1

หรือ รูปแบบ ฟอร์มหลัก.MdiChildren = ฟอร์มลูก (เซตไว้ใน Load ของฟอร์มหลัก)
Set mdiparent form
Form1.MdiChildren = Form2

Date : 2011-09-07 16:09:01 By : InsitizrT
 


 

No. 17

Guest


แล้วถ้าจะกำหนด Location ให้ Mdi ลูก ทำไงครับ เช่น
จะให้ Mdi ลูก อยู่ตรงกลาง Mdi หลัก อ่ะครับ
Date : 2012-06-10 23:25:51 By : Guest
 


 

No. 18



โพสกระทู้ ( 213 )
บทความ ( 0 )



สถานะออฟไลน์


Code
แล้วถ้าจะกำหนด Location ให้ Mdi ลูก ทำไงครับ เช่น
จะให้ Mdi ลูก อยู่ตรงกลาง Mdi หลัก อ่ะครับ


- คลิ๊กฟอร์ม 1 ที --> Propreties --> StartPosition --> CenterScreen
Date : 2012-06-11 09:06:35 By : SeedNew
 


 

No. 19



โพสกระทู้ ( 20 )
บทความ ( 0 )



สถานะออฟไลน์


Hide()
Me.Hide()

โปรแกรมจะยังทำงานอยู่ครับ ยังมีการรัน Process อยู่ครับ

Close
Me.Close()

อันนี้จะปิดโปรแกรมไปเลย จะไม่มีการรัน Process
Date : 2012-06-11 09:51:29 By : hanamivip
 


 

No. 20

Guest


Quote:
แล้วถ้าจะกำหนด Location ให้ Mdi ลูก ทำไงครับ เช่น
จะให้ Mdi ลูก อยู่ตรงกลาง Mdi หลัก อ่ะครับ


- คลิ๊กฟอร์ม 1 ที --> Propreties --> StartPosition --> CenterScreen


มีแบบเป็น Code ไหม ครับ
Date : 2012-06-12 16:00:21 By : GG Girl Gennaration
 


 

No. 21

Guest


Quote:
แล้วถ้าจะกำหนด Location ให้ Mdi ลูก ทำไงครับ เช่น
จะให้ Mdi ลูก อยู่ตรงกลาง Mdi หลัก อ่ะครับ


- คลิ๊กฟอร์ม 1 ที --> Propreties --> StartPosition --> CenterScreen


ลองแล้วไม่ไปอ่ะครับ เอาแบบ Code ที่ กำหนด Location มีไหมครับ
Date : 2012-06-12 16:06:13 By : Guest
 


 

No. 22

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
 


 

No. 23

Guest


การเปิดปิดฟอร์มที่เปิดไว้ภายใต้ฟอร์ม 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 : เจษฎา สิงห์ทองชัย
 


 

No. 24

Guest


อย่าลืมประกาศตัวแปร อย่างนี้นะครับ
Public TempNode As Form
Date : 2017-03-26 14:46:16 By : เจษฎา สิงห์ทองชัย
 


 

No. 25

Guest


ทำไหมรันหน้าฟอร์ม2ขึ้นหน้าฟอร์ม1ตลอด
Date : 2017-06-16 12:14:42 By : นัศรน
 


 

No. 26



โพสกระทู้ ( 3 )
บทความ ( 0 )



สถานะออฟไลน์


ทำไมเวลาเปิด 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
 


 

No. 27



โพสกระทู้ ( 122 )
บทความ ( 0 )



สถานะออฟไลน์


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
 


 

No. 28



โพสกระทู้ ( 9,554 )
บทความ ( 2 )



สถานะออฟไลน์


แล้วแต่วัตถุประสงค์ การ clone มา ทำให้สามารถเปิด form นั้น ได้หลายๆ หน้าต่าง

แต่ถ้าไม่อยากเปิด หลายๆ หน้าต่าง จะใช้ form หลักเลยก็ได้
Date : 2018-10-02 17:02:44 By : Chaidhanan
 


 

No. 29

Guest


คือผมเชื่อมฟอร์มหลักไปฟอร์ม2 ด้วย .Hide() ; .Show() แล้วคับ แต่พอผมจะเชื่อมฟอร์ม2 ให้กับมายังฟอร์มหลักมันไม่ได้อ่ะคับ มันแสดงขึ้นมาแบบนี้คับ
มีใครช่วยแก้ได้มั้ยคับผมไม่เข้าใจตีงนี้จิงๆคับ
ช่วยผมแก้หน่อยคับผม ไม่เข้าใจจริง ๆ คับ
Date : 2019-01-09 16:51:28 By : ฺbeer
 


 

No. 30



โพสกระทู้ ( 4,436 )
บทความ ( 23 )



สถานะออฟไลน์
Facebook

เอาโค้ดส่วนที่ทำงานอื่นมาด้วยครับ
มาแค่นี้ มันบอกอะไรไม่ได้ นอกจากให้อ่านเรื่อง คลาส และ การสืบทอดของคลาส ใหม่
Date : 2019-01-09 16:57:27 By : lamaka.tor
 


 

No. 31

Guest


นี่คับโค๊ดที่ผมเขียนคับ



v

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
 


 

No. 32

Guest


ผมใช้ VB6 รุ่นเก่า ปัญหาคือ ผมมี 2 form , f1 มี text1.text ส่วนF2 มีปุ่มbuttom1, เมื่อเรากดปุ่มที่ F2 แล้วคำว่า YES ไปแสดงที่ช่อง
text1.text ต้องใช้คำสั่งอย่างไรครับ
Date : 2019-01-25 14:02:51 By : am
 


 

No. 33

Guest


ลองใช้ delegate ดูครับ
Date : 2019-01-25 14:57:46 By : Da_che
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : กดปุ่ม เปิด form ใหม่ แล้วให้ form เก่าหายไปทำยังไงค่ะ คือเวลาเรียกหน้าใหม่ หน้าเก่าก็ยังคงอยู่ มันเยอะมากเลยอ่าค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่