منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : الاضافه و الغاء الصور من خلال ImageList بال C# و VB.net
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
كاتب الموضوع : 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]