Jump to content

مساعدة صغيرة ف مكتبة C#


Recommended Posts

السلام عليكم بيحدث اخطاء غريبة في كتابة الكود و لما اكتبه ب

vb.net 

بيجي مظبوط سألت كام شخص قالي المكبة ناقصة ف ايه حلها

احد الاخطأ مثلا

 private void Button2_Click(object sender, EventArgs e)
        {
             
   
               Form2.Show();
                this.Hide();

            
        }

بيجيبلي خطأ و عشان اعلاجها لازم اعرف الفورم من جديد و ده بيؤدي اني لما اضغط علي البوتن اكتر من مرة هيفتح الفورم اكتر من مرة مش نفس الفروم

مثال

 private void Button2_Click(object sender, EventArgs e)
        {
             Form2 ff = new Form2();
                ff.Show();
                this.Hide();

            
        }

 

Edited by SaedAmer
Link to comment

المفروض يبقا كدا

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;
using System.Windows;
using System.IO;

namespace Server_Send_Text
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

      

        private void Button1_Click(object sender, EventArgs e)
        {
           

                ff.Show();
                this.Hide();

              
        private void Button2_Click(object sender, EventArgs e)
        {
             Application.Exit();

            
        }
    }
}

لكن يظهر خطأ

صورة للخطأ

https://1.top4top.net/p_13062u79k1.png

Edited by SaedAmer
Link to comment
  On 30/07/2019 at 22:53, SaedAmer said:

المفروض يبقا كدا

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;
using System.Windows;
using System.IO;

namespace Server_Send_Text
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

      

        private void Button1_Click(object sender, EventArgs e)
        {
           

                ff.Show();
                this.Hide();

              
        private void Button2_Click(object sender, EventArgs e)
        {
             Application.Exit();

            
        }
    }
}

لكن يظهر خطأ

صورة للخطأ

https://1.top4top.net/p_13062u79k1.png

Expand  
    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;
    using System.Windows;
    using System.IO;

    namespace Server_Send_Text
    {
        public partial class Form1 : Form
        {
    Form2 ff = new Form2(); // ff.Show();
            public Form1()
            {
                InitializeComponent();
            }

          

            private void Button1_Click(object sender, EventArgs e)
            {
               

                    ff.Show();
                    this.Hide();

                  
            private void Button2_Click(object sender, EventArgs e)
            {
                 Application.Exit();

                
            }
        }
    }

 

Link to comment
  On 31/07/2019 at 11:05, ميدوح said:

    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;
    using System.Windows;
    using System.IO;

    namespace Server_Send_Text
    {
        public partial class Form1 : Form
        {
    Form2 ff = new Form2(); // ff.Show();
            public Form1()
            {
                InitializeComponent();
            }

          

            private void Button1_Click(object sender, EventArgs e)
            {
               

                    ff.Show();
                    this.Hide();

                  
            private void Button2_Click(object sender, EventArgs e)
            {
                 Application.Exit();

                
            }
        }
    }

 

Expand  

كدا لو ضغط علي البوطن اكتر من مرة هيظهرلي النافذة اكتر من مرة مش نفسها

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...