VB 0.6 TreeView Control lesson Part3

بسم الله الرحمن الرحيم
توقفنا فى الجزء الثانى السابق عند خاصية LabelEdit .
و موضوع اليوم ان شاء الله عن خاصية SelectedItem
SelectedItem Property - خاصية العنصر المختار
و موضوع اليوم ان شاء الله عن خاصية SelectedItem أو العنصر المختار و هى خاصية من خصائص الـ ActiveX Control عموما و لكن فى TreeView تشير الى Nodes و هى العناصر التى يمكن اختيارها .
الــــــــكود :
Object.SelectedItem
حيث Object تشير الى Node .
- و عند تنفيذ SelectedItem فانه يعود بقيمة هى العنصر التى تم اختيارة من مجموعة العناصر .
- مثال : حذف جميع الـ Nodes المختاره و التى ليست Root .
اضف مفتاح Command للـ TreeView4 باسم Delete Child Nodes و الصق الكود التالى فى الحدث Click
' If the selected object is not the root, then remove the Node.
   If TreeView4.SelectedItem.Index <> 1 Then
      Treeview4.Nodes.Remove TreeView1.SelectedItem.Index
   End If
 


قم بتجريب المشروع و اختار اى Node من TreeView4 ثم اضغط على Command باسم
Delete Child Nodes و لاحظ انه يحذف كل الـ Nodes التى ليست Root أو أول Node فى
الـ TreeView4 .
Style Property - خاصية الشكل
الـــــــكود :
Object.Style = number
 
حيث Object تشير الى TreeView و number تشير الى رقم الشكل المشار اليه فى جدول الاعدادات الخاص به :

الاعدادات :
الرقم (الاعدادات)
الوصف
0
نص فقط
1
نص و صورة
2
نص و علامة + أو -
3

نص و علامة + أو - و صورة
4
نص و خطوط
5

نص و خطوط و صورة
6

نص و علامة + أو - و صورة و خطوط
7
الوضع الافتراضى :
نص و علامة + أو - و صورة و خطوط
 
لاحـــــــــــــــــظ :
اذا كان وضع الـ Style يحتوى على Lines خطوط فان خاصية LineStyle تحدد شكل الخط, اما اذا كان وضع الـ Style لا يحتوى على Lines خطوط "على سبيل المثال الوضع 0" فان خاصية LineStyle يتم تجاهلها مباشرة.
و يمكنك تجربة ذلك بمثال عملى على أى TreeView فى المثال المرفوع فى الدرس السابق حيث ستغير الخاصية بالكود أو من خلال شاشة الخصائص.

الجزء القادم :

Comments

  1. Currently it seems like Expression Engine is the best blogging platform out there right
    now. (from what I've read) Is that what you are using on your blog?


    Feel free to surf to my blog DomingoNDrought

    ReplyDelete
  2. It's a pity you don't have a donate button! I'd definitely donate to
    this fantastic blog! I suppose for now i'll settle for book-marking and adding your
    RSS feed to my Google account. I look forward to brand new updates and will talk about this
    site with my Facebook group. Talk soon!

    Feel free to visit my web page ... WeiKHeebsh

    ReplyDelete
  3. I have read a few excellent stuff here. Definitely value bookmarking for revisiting.

    I surprise how a lot attempt you place to make such
    a great informative site.

    Also visit my web blog :: WmVBlaker

    ReplyDelete
  4. This website certainly has all the information and
    facts I needed concerning this subject and didn't know who to ask.



    Feel free to visit my web site; AlfredaYRotenberry

    ReplyDelete
  5. I’m not that much of a internet reader to be honest but your sites really nice,
    keep it up! I'll go ahead and bookmark your website to come back down the road.

    Many thanks

    Feel free to visit my webpage :: BradleyPPaugh

    ReplyDelete
  6. Attractive section of content. I just stumbled upon your
    weblog and in accession capital to assert that I get actually enjoyed
    account your blog posts. Anyway I'll be subscribing to your
    augment and even I achievement you access consistently quickly.


    my website - EmmettRKaehler

    ReplyDelete
  7. Thanks to my father who shared with me about this blog, this webpage is truly amazing.


    my web site ... ArlenDKingsberry

    ReplyDelete

Post a Comment

visual basic 6 source code says (Hi)

VB6 Popular Posts

Free download Visual Basic 6 Documentation MSDN

Visual Basic Online Course - Function Keys (F1 to F12)

Visual Basic Online Course - ListView, Element not found while removing items