منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
الاضافه و الغاء الصور من خلال ImageList بال C# و VB.net - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد .net (http://vb4arb.com/vb/forumdisplay.php?fid=117)
+---- الموضوع : الاضافه و الغاء الصور من خلال ImageList بال C# و VB.net (/showthread.php?tid=6108)



الاضافه و الغاء الصور من خلال ImageList بال C# و VB.net - RaggiTech - 17-10-12

كاتب الموضوع : AhmedEssawy

الاضافه و الغاء الصور من خلال ImageList

الاضافه

' Visual Basic

كود :
[align=left]Public Sub LoadImage()
Dim myImage As System.Drawing.Image = _
Image.FromFile _
(System.Environment.GetFolderPath _
(System.Environment.SpecialFolder.Personal) _
& "\Image.gif")
ImageList1.Images.Add(myImage)
End Sub[/align]

// C#

كود :
[align=left]public void addImage()
{
// Be sure to use an appropriate escape sequence (such as the
// @) when specifying the location of the file.
System.Drawing.Image myImage =
Image.FromFile
(System.Environment.GetFolderPath
(System.Environment.SpecialFolder.Personal)
+ @"\Image.gif");
imageList1.Images.Add(myImage);
}[/align]

الالغاء

' Visual Basic

كود :
[align=left]' Removes the first image in the image list
ImageList1.Images.Remove(myImage)
' Clears all images in the image list
ImageList1.Images.Clear()[/align]
// C#

كود :
[align=left]// Removes the first image in the image list.
imageList1.Images.Remove(myImage);
// Clears all images in the image list.
imageList1.Images.Clear();

imageList1->Images->Clear();[/align]