Test Foro de elhacker.net SMF 2.1

Programación => .NET (C#, VB.NET, ASP) => Programación General => Programación Visual Basic => Mensaje iniciado por: ntaryl en 4 Enero 2011, 22:11 PM

Título: imagelist Questions
Publicado por: ntaryl en 4 Enero 2011, 22:11 PM
Good  evening   
I use a picture to load a gif from a dll .
When  add a picture in Imagelist use <<Call Form1.img.ListImages.Add(, , Form1.Flag.Picture)>>
want to Load severals gifs in the Imagelist
How can call the Items  from the Imagelist in ListView ?
thanks for the time  .
No want to add All together  .....

Ps This  project use GetLocaleInfo  to find what Country u are from and add the flag(gif)in the ListView.


Título: Re: imagelist Questions
Publicado por: BlackZeroX en 4 Enero 2011, 22:52 PM
.
WHAT WE WANT IS PUT IMAGES in a ListView?


Relacionar ImageList

Código (Vb) [Seleccionar]


    ListView.Icons = ListIcon         'Relaciona una coleccion de images Normales      (Optional)
    ListView.SmallIcons = ListIcon 'Relaciona una coleccion de imagenes pequeñas (Optional)



Relacionar Iconos con los Items

Código (vb) [Seleccionar]


        ListView.ListItems.Add , , "Hola Mundo", IndexIconNormal, IndexICOnPequeño
        ListView.ListItems.Item(IndexITem).Icon = IndexIconNormal
        ListView.ListItems.Item(IndexITem).SmallIcon = IndexIconoPequeño



Nota: Las imagenes Gif No son animadas en los Items ya que en el imagelist las convierte a Iconos al cargar en el mismo.

(translate.google.com.mx)
Note: Gif images are not animated in the Items because in the imagelist icons convert them to upload it.

Temibles Lunas!¡.
Título: Re: imagelist Questions
Publicado por: ntaryl en 4 Enero 2011, 23:37 PM
Thanks for the Reply my Friend
I know the gif  not animated  .
i will check it  tomorow 
I load the Gif from dll in the imagelist and want to use it from there
if u have time  givea look




http://www.mediafire.com/?8nf5c24ypk5ih09
Título: Re: imagelist Questions
Publicado por: BlackZeroX en 5 Enero 2011, 01:57 AM
.
I' Not Clear You SourceCode only Relate the imagelist with ListView

Código (Vb) [Seleccionar]


Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long

Private Const LOCALE_SYSTEM_DEFAULT As Long = &H400
Private Const LOCALE_SENGCOUNTRY = &H1002

Private objCnSRes           As Object

Private Sub Command1_Click()
    With Lv.ListItems.Add(, , "aaa", GetFlag(GetCountry), GetFlag(GetCountry))
        .SubItems(1) = "0.0.0.0"
        .SubItems(2) = "1111"
    End With
End Sub

Private Sub Form_Load()
Dim lvitem              As ListItem

    With Lv
   
        '   Initialize ImageList
        Set objCnSRes = CreateObject("Flags.cRec")
        '   //  In the DLL Declare CountImages  ( Cant of Images ),
        For lng_i = 1 To objCnSRes.CountImages
            '  // is added 100 for the id of the image resources
            Call img.ListImages.Add(, , objCnSRes.GetPicture(lng_i+100, GIF))
        Next lng_i
        Set objCnSRes = Nothing
       
       
        .Icons = img    'Relate ImageList With The ListView.
        .View = lvwReport
        Call .ColumnHeaders.Add(, , ".#.", 2000, vbLeftJustify)
        Call .ColumnHeaders.Add(, , "Proxy IP ", 2000, vbLeftJustify)
        Call .ColumnHeaders.Add(, , "Port", 1300, vbLeftJustify)
       
    End With
End Sub

Public Function GetCountry() As String
Dim sName As String * 256, lBuffSize As Long
    lBuffSize = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGCOUNTRY, ByVal sName, Len(sName))
    GetCountry = Left(sName, lBuffSize - 1)
End Function

Public Function GetFlag(sCountry As String) As Long
    Select Case LCase(sCountry)
        Case "greece"
            GetFlag = 1
        Case "argentina"
            GetFlag = 2
        Case "mexico"   '   //  This my State
            GetFlag = 1
        'Case Else
            'GetFlag = 0 '   //  Case Defaul Image
    End Select
End Function



Dulce Infierno Lunar!¡.
.
Título: Re: imagelist Questions
Publicado por: ntaryl en 5 Enero 2011, 21:49 PM
Thanks  man   i will check it  now 
Título: Re: imagelist Questions
Publicado por: BlackZeroX en 5 Enero 2011, 21:58 PM
.
:silbar: :silbar:

Sin Dependencias de OCX...

http://foro.elhacker.net/programacion_visual_basic/srcuc_listviewex_20_reprogramado_05012011_no_skiner-t315820.0.html

:silbar: :silbar:


Dulces Lunas!¡.
Título: Re: imagelist Questions
Publicado por: ntaryl en 6 Enero 2011, 00:00 AM
I  cant  fix it to work with the

GetFlag(GetCountry)

Thanks  for the time 
Título: Re: imagelist Questions
Publicado por: BlackZeroX en 6 Enero 2011, 00:26 AM

Código (vb) [Seleccionar]


GetFlag(GetCountry)



Esta funcion retorna el indice de la imagen en el ImageList.

http://translate.google.com.mx/
This function returns the index of the image in the ImageList.

Dulces Lunas!¡.
Título: Re: imagelist Questions
Publicado por: ntaryl en 6 Enero 2011, 22:50 PM
My stupid mistake
i use (Greece)
and the correct is greece
havea good  night  bro