.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

messagebox ใน xna Options · View
whiteline
Posted: Saturday, January 12, 2008 11:34:43 PM
Rank: มือพระกาฬ
Groups: Member

Joined: 12/3/2007
Posts: 12
Location: Silpakorn

อยากจะได้ messagebox มาใช้กับเค้าบ้าง  โดยปกติแล้ว ใน XBOX  จะไม่อนุญาติให้ใช้

แต่ในจังหวะที่อยู่ในช่วงพัฒนาคงจะมีประโยชน์บ้าง (มั่ง)

ก้ออยากได้อะ อยากได้ๆ (จะเอาๆ ลงไปดิ้นๆ ตรงบันไดเลื่อน)

ไม่รู้ทำไง ไปถามพี่กู (พี่ google )แล้วกัน

พี่กูบอกว่า ให้ลองไปใช้ Windows API ในการติดต่อ ซึ่งจะเป็นวิธีที่ง่าย ในการแสดง messagebox นะค่ะ

แต่ยังไง อย่าลืมนะว่าใน XBOX จาใช้ไม่ได้งิ.!

.....

.....

ได้ดังนี้

ก่อนอื่นไป Using ตัวนี้เพิ่มก่อน

 

using System.Runtime.InteropServices;

 

เพิ่มสองบรรทัดนี้ก่อนนะ

[DllImport("user32.dll", CharSet = CharSet.Auto)]

 public static extern uint MessageBox(IntPtr hWnd, String text, String caption, uint type);

// ส่วนแสดงผล

MessageBox(new IntPtr(0), "รักนะแสดงออก .. รู้ไหม", "MsgBox Title นะค่ะ", 0);

ผลการทดลอง 

 messagebox xna

ได้มาแบบเนี้ยอะค่ะ  อืม... บางครั้งปัญหา สระลอยก้อแก้ได้ มั่วไปก่อนโดย msgbox ก้อได้มั่งนะงิ

...

เฮือก...

จบแระ บับบาย

งุงิ งุงิ

เอกสารอ้างอิง Displaying a MessageBox in XNA

 

 

 

MessageBox(new IntPtr(0), "รักนะแสดงออก .. รู้ไหม", "MsgBox Title นะค่ะ", 0);

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by