فرم های من همه 1024*768 هستند و عکس های بک گراند هم همین سایزند . اون فعلا مشکلش حل شده مگر اینکه موقع اجرا از طریق فایل exe دوباره بخواد مشکل داشته باشه . چون ظاهرا از بافری دوبرابر بقیه استفاده می کنه
در مورد کد فرم ها :
یک نمونه : عکس ها ضمیمه هست
مثلا در اینجا فرم game فرم پدر هست و فرم playgame فرزند که موقعی که روی یکی از بازی های فرم game کلیک بشه فرم game پنهان می شه و فرم playgame باز می شه ... از الگوی سینگلتون استفاده کردم ...
کد فرم game
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace childfriend
{
public partial class game : Form
{
private playgame play;
public game()
{
InitializeComponent();
}
private void pictureBox4_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "Fishing";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox3_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "Panic Pro!";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "Monkey lander";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "Zed";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox5_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "The Penalty Challenge";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox6_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "V-Force";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox7_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "Worm Food";
play.Tag = this;
play.ShowDialog();
}
private void pictureBox8_Click(object sender, EventArgs e)
{
this.Hide();
play = GenericSingleton<playgame>.GetInstance();
play.game = "River Kayak";
play.Tag = this;
play.ShowDialog();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
//don't let close form with ALT+F4
protected override System.Boolean ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
{
if ((msg.Msg == 0x104) && (((int)msg.LParam) == 0x203e0001))
return true;
return false;
}
}
}
کد فرم plagegame :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace childfriend
{
public partial class playgame : Form
{
public string game;
public playgame()
{
InitializeComponent();
}
private void playgame_Load(object sender, EventArgs e)
{
axShockwaveFlash1.Movie = Application.StartupPath + @"\flash\kidsgame\" + game + ".swf";
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
foreach (Form MyGame in Application.OpenForms)
{
if (MyGame is game)
Application.OpenForms["game"].Show();
}
}
//don't let close form with ALT+F4
protected override System.Boolean ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData)
{
if ((msg.Msg == 0x104) && (((int)msg.LParam) == 0x203e0001))
return true;
return false;
}
}
}
ممنون از توجهتون