الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

من الداتا إلى الشجرة

مغلق
بدأه booknet في 16 مارس 2007 · 3 رد · 539 مشاهدة · في لغة Ms Visual Basic 6 وما قبلها من إصدارات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

في المثال المرفق يقرأ البرنامج الداتا إلى الشجرة والمشكلة أن القرآئة تكون من (Z إلى A ) والمفروض أن تكون من (A إلى Z )

الرجاء المساعدة في تعديل الكود

وشكرا

ALPHABET.zip

#2

اعكس الطريقه بدل ما تروح اول الملف اذهب الى اخر الملف ثم تحرك الرسجلات بالعكس

علامه ******* هي التغير

	'rsSections.MoveFirst	 '***************'
	rsSections.MoveLast	   '<-----*********
	Set tvCodeItems.ImageList = Nothing
	Set tvCodeItems.ImageList = ImageList1
'
' Populate the TreeView Nodes
'

	With tvCodeItems.Nodes
		.Clear
		.Add , , "ROOT", "ALPHABET", "BOOK"
'
' Make our Root Item BOLD
'
		BoldTreeNode tvCodeItems.Nodes("ROOT")
'
' Now add all nodes into TreeView, but under the root item.
' We reparent the nodes in the next step

		Do Until rsSections.BOF   'rsSections.EOF '*****<-----

			sParent = rsSections("ParentID").Value
			sKey = rsSections("ID").Value
			sText = rsSections("Description").Value
			Set nNode = .Add("ROOT", tvwChild, "C" & sKey, sText, "BOOK")
'
' Record parent ID

			nNode.Tag = "C" & sParent
			'rsSections.MoveNext	  '******
			rsSections.MovePrevious   '<-----

		Loop

	End With
#3

الأخ الفاضل ...

فى الدالة FillTree قم بتغير طريقة الترتيب فى جملة sql من

Set rsSections = mDB.OpenRecordset("select * from codeitems order by ID", dbOpenSnapshot)

إلى

Set rsSections = mDB.OpenRecordset("select * from codeitems order by ID DESC", dbOpenSnapshot)

أو الأفضل

Set rsSections = mDB.OpenRecordset("select * from codeitems order by Description DESC", dbOpenSnapshot)

شكراً

Eng. Usama El-Mokadem

Nothing is impossible, the word impossible itself says that: I M - Possible

#4

شكرا لكما وجزاكما الله خيرا

الطريقتان نافعتان

هذا الموضوع مغلق.

مواضيع مشابهة