17-10-12, 04:50 PM
كاتب الموضوع : 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
' 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]