 |
:: عضو فضي ::
تاريخ التسجيل: Feb 2010
الدولة: تونس (بدرس بالأردن)
المشاركات: 454
|
|
نشاط [ Eng-Rayan ]
قوة السمعة:
|
|
22-05-2010, 08:13 PM
المشاركة 61
|
|
|
عزيزي Eng-Rayan
أريد الكود كشيفرة فقط كي أنسخها للتقرير فقط
ولا أريد الواجهات والباقي . لأنني لم أتسطيع فتح ملفات السورس كود
التي قمت بتحميهلها لي .
محبتي
|
اكيد اخي
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Robot_Parallel_Port
{
public partial class Form1 : DevComponents.DotNetBar.Office2007Form
{
public Form1()
{
InitializeComponent();
// Create a TextBox control.
TextBox tb = textBox3;
this.Controls.Add(tb);
tb.KeyPress += new KeyPressEventHandler(keypressed);
}
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint = "Out32")]
public static extern void Output(int adress, int value);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void buttonX1_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 10);
textBox1.Text = "5 and 3";
textBox2.Text = "1010";
}
private void buttonX4_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 2);
textBox1.Text = "3";
textBox2.Text = "0010";
}
private void buttonX5_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 0);
textBox1.Text = "Nothing";
textBox2.Text = "0000";
}
private void buttonX3_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 8);
textBox1.Text = "5";
textBox2.Text = "1000";
}
private void buttonX2_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 9);
textBox1.Text = "5 and 2";
textBox2.Text = "1001";
}
private void buttonX6_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 1);
textBox1.Text = "2";
textBox2.Text = "0001";
}
private void buttonX7_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 6);
textBox1.Text = "4 and 3";
textBox2.Text = "0110";
}
private void buttonX8_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 4);
textBox1.Text = "4";
textBox2.Text = "0100";
}
private void buttonX9_Click(object sender, EventArgs e)
{
PortAccess.Output(888, 5);
textBox1.Text = "4 and 2";
textBox2.Text = "0101";
}
void keypressed(Object o, KeyPressEventArgs e)
{
if (e.KeyChar == (char)102)
{
e.Handled = true;
PortAccess.Output(888, 10);
textBox1.Text = "5 and 3";
textBox2.Text = "1010";
textBox3.Text = "F button pressed";
}
else if (e.KeyChar == (char)98)
{
e.Handled = true;
PortAccess.Output(888, 2);
textBox1.Text = "3";
textBox2.Text = "0010";
textBox3.Text = "B button pressed";
}
else if (e.KeyChar == (char)114)
{
e.Handled = true;
PortAccess.Output(888, 8);
textBox1.Text = "5";
textBox2.Text = "1000";
textBox3.Text = "R button pressed";
}
else if (e.KeyChar == (char)108)
{
e.Handled = true;
PortAccess.Output(888, 9);
textBox1.Text = "5 and 2";
textBox2.Text = "1001";
textBox3.Text = "L button pressed";
}
else if (e.KeyChar == (char)111)
{
e.Handled = true;
PortAccess.Output(888, 4);
textBox1.Text = "4";
textBox2.Text = "0100";
textBox3.Text = "O button pressed";
}
else if (e.KeyChar == (char)112)
{
e.Handled = true;
PortAccess.Output(888, 5);
textBox1.Text = "4 and 2";
textBox2.Text = "0101";
textBox3.Text = "P button pressed";
}
else if (e.KeyChar == (char)97)
{
e.Handled = true;
PortAccess.Output(888, 1);
textBox1.Text = "2";
textBox2.Text = "0001";
textBox3.Text = "A button pressed";
}
else if (e.KeyChar == (char)100)
{
e.Handled = true;
PortAccess.Output(888, 6);
textBox1.Text = "4 and 3";
textBox2.Text = "0110";
textBox3.Text = "D button pressed";
}
else if (e.KeyChar == (char)99)
{
e.Handled = true;
PortAccess.Output(888, 0);
textBox1.Text = "Nothing";
textBox2.Text = "0000";
textBox3.Text = "C button pressed";
}
}
}
}
|
هذا هو الكود بالكامل و ارجو ان اكود قد اديت واجبي
انا لم اعمل العمل هذا من اجل ان اتبهى بل هذا العمل لوجه الله و هذا لاساعد اخواني المسلمين
بالتوفيق
|