Search VB 2010

Sunday, April 24, 2011

OOP VB .Net Toturials and Examples - دروس فى ال أو أو بى

تعرفنا على الوراثه Access Modifiers

 مشروع عملى لتطوير الــ TextBox
صورة رقم 28

و سيكون ذلك عن طريق اضافة خاصيه جديده كمثال ثم استخدام الـ TextBox الجديده فى مشاريعك الخاصه بعد ذلك و هى خاصية TypeOfChr أو نوع الكتابه فى الـ TextBox (نص - رقم - كلاهما) .
بداية : قم بعمل مشروع جديدمن نوع (Windows Control Liberary) فالــ TextBox فى النهايه هى Control كما بالصورة رقم 28 لكن سنقوم بتغيير الاسم الى MyNewTextBox و الامر يعود اليك ...... و ستتم عملية التطوير عن طريق استخدام خاصية Inheritance أو الوراثه حيث سنقوم بفتح الـ Class TextBox و وراثته و الاضافه عليه .... كيف ؟؟؟
انظر الصورة رقم 29 حيث نتوجة الى شاشة Solution Explorer و نختار Show All Files ستظهر لنا جميع الملفات ثم نذهب الى UserControl1 و نفتح القائمه التى يمثلها نجد ملفين (Resx - Designer) نختار Designer

صورة رقم 31

صورة رقم 30

لاحظ : عند فتح ملف الـ Designer للتعديل كما بالصورة رقم 30 كود الوراثه نقوم بتغيير كلمة UserControl الى TextBox لأننا سنرث الـ TextBox و ايضا يوجد اجراء اسمه InitializeComponent يحتوى على سطرين أكواد عباره عن تحديد مكان الـ Control الجديد الذى نعمل عليه و الذى يعتبر الان هو الـ TextBox و بالتالى لن نلتزم بمكان الـ Control الجديد لذا سنقوم بتحويل السطرين الى Comments حتى نبطل عملهم كما بالصورة رقم 31 و نقوم بالحفظ Ctrl+S ..... ثم سنقوم باضافة مشروع (Add Project) من قائمة File و فائدته أننا سنقوم بتجربة الـ Control الجديد عليه , الان قم باضافة الـ Control الجديد UserControl1 على الـ Form1 بالمشروع المضاف .... و لكن كيف ؟؟؟
صورة رقم 29
سنتوجه الى الــ ToolBox و نقوم بعمل Right-Click و نختار Choose Item حيث ستفتح شاشه جديده كما بالصورة رقم 32 و رقم 33 و نختار الــ Control الجديد UserControl1 و المسمى MyNewTextBox من المجلد Release من داخل المشروع  و بعدها سيظهر فى قائمة ToolBox باسم UserControl1 نقوم باضافته الى الــ Form1 سنلاحظ أنه أخذ شكل الــ TextBox عند اضافته ..... و هنا نكون قد انتهينا من تصميم الـ Control الجديد الموروث من الـ Control TextBox و الان حان وقت البرمجه و هى برمجه الخاصيه TypeOfChr .....

صورة رقم 33

صورة رقم 32

صورة رقم 35

نفتح شاشة كود الـ UserControl1 نجدها كما بالصورة رقم 34
صورة رقم 34
 وقفه ................... الان ماذا نريد (نريد عمل خاصيه أى أننا المفروض بعد الانتهاء سنحصل على خاصيه موجوده فى شاشة الــ Property كما بالصورة رقم 35 للأداه التى قمنا بوراثتها الان و هى TextBox و تكون الخاصيه عباره عن ComboBox به 3 اختيارات Number - Text - Box حيث بعد اضافة الاداه على الـ Form  يمكن للمستخدم اختيار Number اذا اراد ان يكتب أرقام فقط ,,, المستخدم هو المبرمج الذى سينتقل له الاداه أو من تقوم بصناعة الاداه له لاستخدامها سواء فالبرمجه أو لمشروع لعميل ...... و السؤال الان كيف نصنع ذلك ؟؟
الاجابه عن طريق الــ Enum


16 comments:

  1. My programmer is trying to convince me to move to
    .net from PHP. I have always disliked the idea because of the expenses.
    But he's tryiong none the less. I've been using WordPress on a
    variety of websites for about a year and
    am anxious about switching to another platform. I have heard good things
    about blogengine.net. Is there a way I can transfer
    all my wordpress content into it? Any help would be really appreciated!


    Here is my blog: sex en video gratuit []

    ReplyDelete
  2. A person essentially lend a hand to make seriously posts I would state.

    That is the first time I frequented your website page and thus far?
    I amazed with the research you made to make
    this actual post amazing. Wonderful process!

    My web site: sexe et film

    ReplyDelete
  3. Unquestionably believe that that you stated.
    Your favourite reason appeared to be at the internet the simplest factor to keep in mind of.
    I say to you, I definitely get irked whilst people
    consider issues that they just don't realize about. You managed to hit the nail upon the highest and defined out the entire thing with no need side-effects , other folks could take a signal. Will probably be back to get more. Thank you

    my webpage - x en streaming gratuit []

    ReplyDelete
  4. I appreciate the details on your website.
    Much thanks!

    Here is my web site: gay porne - -

    ReplyDelete
  5. Wow, amazing blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your website is
    excellent, let alone the content!

    Look at my blog post :: film x francais en streaming gratuit (canaankumc.org)

    ReplyDelete
  6. Hello, Neat post. There is a problem along with your site in web explorer, might test this� IE nonetheless is the market chief and a large section of
    folks will miss your wonderful writing due to this problem.



    My web site :: meilleur site video porno gratuit (www.vype.nl)

    ReplyDelete
  7. Thank you for another informative site. Where else could I get that type of information written in such an ideal way?
    I've a project that I'm just now working on, and I have been on the look out for
    such info.

    My web blog video x totalement gratuite ()

    ReplyDelete
  8. Hi! This is my first comment here so I just wanted to give a quick shout out and tell you I really
    enjoy reading through your articles. Can you recommend any other blogs/websites/forums that deal with
    the same topics? Thank you so much!

    Feel free to visit my webpage stream porn movies

    ReplyDelete
  9. Nice blog! Is your theme custom made or did you download
    it from somewhere? A design like yours with a few simple tweeks would really make my blog shine.

    Please let me know where you got your design. Many thanks

    Here is my webpage: film q stream

    ReplyDelete
  10. Needed to draft you one little bit of note just to thank you
    once again just for the nice techniques you have provided in this
    case. It was simply open-handed of people like you
    to provide extensively what most of us could possibly have marketed
    for an e book to earn some cash for their own end, particularly considering
    the fact that you might have done it if you wanted. The basics likewise
    acted to be the good way to be sure that many people have the same dreams like my very own
    to understand more around this issue. I am sure there are
    many more pleasurable instances ahead for people who browse through
    your blog post.

    Here is my web page; porn gratuit streaming (www.escortschn.com)

    ReplyDelete
  11. You can definitely see your enthusiasm in the article you write.
    The sector hopes for more passionate writers such as you who aren't afraid to mention
    how they believe. All the time go after your heart.


    my web page - film xgratuit

    ReplyDelete
  12. Pretty nice post. I simply stumbled upon your blog and wished to say that I have
    truly enjoyed surfing around your weblog posts. After all I will
    be subscribing on your rss feed and I hope you write once more very soon!


    Also visit my web blog; film sexe asiatique

    ReplyDelete
  13. It's genuinely very complex in this full of activity life to listen news on Television, so I simply use web for that purpose, and get the most recent
    news.

    Look into my web blog - video x streaming francaise (http://khandeshproperties.com/)

    ReplyDelete
  14. Can I simply say what a relief to find somebody who truly knows what
    theyre talking about on the internet. You undoubtedly know the best way to convey an issue to light and make it important.
    Extra individuals have to read this and understand this aspect of the
    story. I cant imagine youre not more fashionable because you
    positively have the gift.

    Take a look at my web site :: bites xxx

    ReplyDelete
  15. Wonderful article! That is the type of information that are
    supposed to be shared around the internet. Disgrace on the seek engines
    for now not positioning this submit upper! Come on over and
    seek advice from my website . Thanks =)

    Feel free to surf to my weblog ... francais sexe video

    ReplyDelete
  16. Thanks for your personal marvelous posting! I truly enjoyed reading it, you can be a
    great author.I will make certain to bookmark your blog
    and will often come back in the future. I want to encourage you to continue
    your great job, have a nice holiday weekend!

    Stop by my homepage; regarder x gratuit (www.twerk-videos.com)

    ReplyDelete

Visual Basic Online Course

Visual Basic Courses - Share