Page 1 of 2 12 LastLast
Results 1 to 40 of 48

Thread: [RESOLVED] If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Resolved [RESOLVED] If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    I am trying to get a ListBox, itemdata to show a certain PictureBox in a control array, to be shown that has the same index number.

    For example:
    If List1.ItemData(1) Then Picture1(1).Visible = True

    Thanks in advance!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    How about this:

    Picture1(List1.ListIndex).Visible = True

  3. #3

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Thanks, I will try that!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  4. #4

  5. #5

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Thanks I will try it!!
    Last edited by ThEiMp; Apr 2nd, 2010 at 12:47 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  6. #6

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    I am getting an error message: It says that the control in the array, doesn't exist.

    Yes, I know that. Because I haven't made it yet. But then we need error checking, to check if the control has been loaded at that time. Then if it hasn't then exit sub, if the control has been loaded then continue with the process.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  7. #7
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    So do error handling then. And make sure that you have as much picture boxes as there are items in the list. Rhino already told you about this "... if of course you do have as many pictureboxes as list1.listcount "

  8. #8

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    So its a For .... Next loop, right???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  9. #9

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Still getting the same error. Using this code:
    Code:
    Option Explicit
    Dim aa As Long
    Dim sMyItem As String
    
    Public Sub Command1_Click()
       For aa = 0 To Form1.List1.ListCount - 1
            If sMyItem = Form1.List1.List(aa) Then Exit Sub
       Next
    Form11.BackGround1(Form1.List1.ListIndex).ZOrder "0" = Form1.List1.ItemData(Form1.List1.ListIndex)
    Form11.BackGround1(Form1.List1.ListIndex).Visible = Form1.List1.ItemData(Form1.List1.ListIndex)
    Exit Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  10. #10
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Compare Picture1.Count with List1.ListCount

  11. #11

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Thanks, I will try it!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  12. #12

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Getting an error process, happening!!

    Error: I cannot use the set properties of the say for at least, to example: Two pictureboxes. I have tried to set them at run-time two different sizes. (Height and Width settings). But then that doesn't work at all. Even when I .Visible = True & .Zorder "0" one of them.

    Here is the whole handler's source code to that problem that I am having:
    Code:
    Public Sub List1_Click()
    On Error Resume Next
    
    Dim aa As Long
    
    If Form1.Text2.Text = "0" Then Exit Sub
    If Form1.Text2.Text = "1" Then GoSub List1Item1
    Exit Sub
    
    List1Item1:
    If Form1.List1.ItemData(Form1.List1.ListIndex) = "0" Then GoSub ItemAEquals1
    If Form1.List1.ItemData(Form1.List1.ListIndex) <> "0" Then GoSub ItemAEquals2
    Exit Sub
    
    ItemAEquals1:
    Form1.SSTab1.Tab = "1"
    
    Form11.Hide
    Form10.Hide
    Form12.Hide
    Form13.Hide
    Form14.Hide
    Exit Sub
    
    ItemAEquals2:
    Form1.SSTab1.Tab = "1"
    
    Form11.Show vbModeless, Me
    
    Form10.Hide
    Form12.Hide
    Form13.Hide
    Form14.Hide
    
       For aa = 0 To Form1.List1.ListCount - 1
       Form11.BackGround1(Form11.BackGround1.Count - 1).ZOrder "0" = Form1.List1.ItemData(Form1.List1.ListIndex)
        Form11.BackGround1(Form11.BackGround1.Count - 1).Visible = Form1.List1.ItemData(Form1.List1.ListIndex)
       Next
    Exit Sub
    
    End Sub
    Last edited by ThEiMp; Apr 2nd, 2010 at 02:45 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  13. #13
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    I'm sorry to have to say this but that's terrible code.

    Some things for you to think about and/or fix:
    1) On Error Resume Next. When you use that it hides any errors you may be running into. There are sometimes reasons for doing that but I suspect that you are doing it just because you are getting an error that you don't know how to fix.
    2) You have been told repeatadly that ItemData can only be numeric so why are you doing things like If Form1.List1.ItemData(Form1.List1.ListIndex) = "0" ?
    3) There is no reason for you to use GoSubs. While there are rare (very rare) occasions when it is proper to use them, your code doesn't need them. For example:

    Code:
    If Form1.List1.ItemData(Form1.List1.ListIndex) = 0 Then
        Form1.SSTab1.Tab = "1"
        
        Form11.Hide
        Form10.Hide
        Form12.Hide
        Form13.Hide
        Form14.Hide
        Exit Sub
    Else
        Form1.SSTab1.Tab = "1"
        
        Form11.Show vbModeless, Me
        
        Form10.Hide
        Form12.Hide
        Form13.Hide
        Form14.Hide
    
        Exit Sub
    End If
    There are other obvious improvments that could also be made to that code.
    4) I have no idea what you are trying to do with these two lines.
    Code:
       Form11.BackGround1(Form11.BackGround1.Count - 1).ZOrder "0" = Form1.List1.ItemData(Form1.List1.ListIndex)
        Form11.BackGround1(Form11.BackGround1.Count - 1).Visible = Form1.List1.ItemData(Form1.List1.ListIndex)
       Next
    For one thing the Visible property expects a True or False value so unless Form1.List1.ItemData(Form1.List1.ListIndex) translates to one of them you will get an error (which you won't see because of the On error Resume Next).

  14. #14

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Right Now: Problems fixed!! Removed the On Error statement. But then with the PictureBoxes. They run the control arrays, all on each other. Even when they have specific controls made on a certain PictureBox. They all show the same controls, in their positions that they were made in.

    So far: I cannot move the controls, after they have been Loaded, using the Load statement. That will come in the near future of the project.

    --
    Are you sure that the statement "On Error Resume Next" is that kind of bad programming??? What can I use as error handling???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  15. #15
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    Are you sure that the statement "On Error Resume Next" is that kind of bad programming??? What can I use as error handling???
    Yes it is *that* bad. Look at this tutorial http://www.vb6.us/tutorials/error-handling-visual-basic

  16. #16
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Here is a very simple example.
    Code:
    Private Sub Form_Load()
    
        On Error GoTo ErrorRoutine
    
        MsgBox 7 / 0
    
        Exit Sub
    
    ErrorRoutine:
        
        MsgBox "Error " & Err.Number _
             & "(" & Err.Description & ") generated in Form_Load"
             
    End Sub

  17. #17

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Now: About the getting the controls that were formed in a control array, to be in their respective PictureBoxes, as in the Container, that I have made for them. They don't escape, from the PictureBox. So then, why are they being overlapped, in every PictureBox, that I make in the Project???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  18. #18

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by MartinLiss View Post
    Here is a very simple example.
    Code:
    MsgBox 7 / 0
    I have been a programmer for many years. In previous versions of VB, and Windows. And have never seen a statement like that!!

    I was always told to do it like this:
    Code:
    MsgBox "Hello" , , "Message"
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  19. #19
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    When you load those extra controls you have to Set their Container property if you want to 'embed' them in a Picture box. Then after that set their position within the container.

  20. #20

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Done that. But then I must make a proper reference to the actual PictureBox, that I wish to make as the Container.

    Cause this is the code that I am using to do so:
    Code:
    MakeCommandButton1:
    c = c + 1
    
    Form12.Combo3.AddItem "Command" & c
    Form14.Combo1.AddItem "Command" & c
    
    Form12.Combo2.Clear
    Form12.Combo2.AddItem "Click"
    Form12.Combo2.AddItem "Double Click"
    
        Load FrameBox1(c)
        Load imgBox1(c)
        Load labCaption1(c)
        Set FrameBox1(c).Container = Form11.BackGround1(l)
        Set imgBox1(c).Container = FrameBox1(c)
        Set labCaption1(c).Container = FrameBox1(c)
        
        FrameBox1(c).Top = Y - FrameBox1(c).Height / 2
        FrameBox1(c).Left = X - FrameBox1(c).Width / 2
        labCaption1(c).Caption = "Command" & c
        FrameBox1(c).Visible = True
        imgBox1(c).Visible = True
        labCaption1(c).Visible = True
        labCaption1(c).ZOrder "0"
    
    Form1.Text3.Text = "0"
    Exit Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  21. #21
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    I have been a programmer for many years. In previous version of VB, and Windows. And have never seen a statement like that!!

    I was always told to do it like this:
    Code:
    MsgBox "Hello" , , "Message"
    I dont think Martin's idea was to tell you how to use the Message Box but rather how to use error handling and Err object. The MsgBox 7/0 is simply there to generate an error, because divison by zero is not allowed. If you would have tried the code first you would have noticed the difference. Doing it without error handling would have crashed your application while with error handling it would show a message and continue working.

  22. #22
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    I have been a programmer for many years. In previous versions of VB, and Windows. And have never seen a statement like that!!

    I was always told to do it like this:
    Code:
    MsgBox "Hello" , , "Message"
    Well sure but you can always do something like Msgbox 4 + 7 which will display 11.

  23. #23

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    ??? lol What???

    Why not something like this:
    Code:
    MsgBox 11
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  24. #24
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Here is code for a Listbox that is in a picturebox. The listbox's Index is zero so it's a control array and the last line moves the new member of the control array. What are you doing differently?

    Load List1(1)
    List1(1).Visible = True
    List1(1).Move 500, 250

  25. #25

  26. #26
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    ??? lol What???

    Why not something like this:
    Code:
    MsgBox 11
    You are *completely* missing the point of everything we are telling you...

  27. #27

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    The samething, that you are doing. But with things, like Event handling and also Sub handling, for the coding window.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  28. #28

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Wait: Can we do it like this???
    Code:
    Load List1(1)
    List1(1).Visible = True
    List1(1).Move X, Y
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  29. #29
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    Wait: Can we do it like this???
    Code:
    Load List1(1)
    List1(1).Visible = True
    List1(1).Move X, Y
    Sure, if X and Y have the values of the proposed Top and Left.

  30. #30

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Major Problem #1:
    Code:
    Set Label1(a).Container = Form11.BackGround1(0)
    This points to no kind of control array, in any aspect in the Project. I mean: That instead of .Index = "0", it must be something, and that has to be a valid Index. In my case: I must be able to make it the current PictureBox, that the end-user, had just clicked on with the mouse.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  31. #31
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    Major Problem #1:
    Code:
    Set Label1(a).Container = Form11.BackGround1(0)
    This points to no kind of control array, in any aspect in the Project. I mean: That instead of .Index = "0", it must be something, and that has to be a valid Index. In my case: I must be able to make it the current PictureBox, that the end-user, had just clicked on with the mouse.
    That makes absolutely no sense so please try to say it it another way. Also since you say you "have been a programmer for many years. In previous versions of VB" then surely you must understand the dfference between strings and numbers, so why do you continue to do things like .Index = "0"???

  32. #32

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Well I was talking in pesudo code, and not VB or machine lingo.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  33. #33
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Okay, fine but how about rewording this?

    "This points to no kind of control array, in any aspect in the Project. I mean: That instead of .Index = "0", it must be something, and that has to be a valid Index. In my case: I must be able to make it the current PictureBox, that the end-user, had just clicked on with the mouse."

  34. #34

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Right: I refer to my PictureBox control array, using the (l) for the Index. And also (0) for the Index, in the same project. But I had changed the code to view it, using the code in this thread. It is viewed right, but overlapping and not letting me see the previous PictureBox at all!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  35. #35

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Code Repair: It now looks like this.
    Is this correct, or there about???
    Code:
    Public Sub List1_Click()
    Dim aa As Long
    
    If Form1.List1.ItemData(Form1.List1.ListIndex) = "0" Then
        Form1.SSTab1.Tab = "1"
        
        Form11.Hide
        Form10.Hide
        Form12.Hide
        Form13.Hide
        Form14.Hide
        Exit Sub
    Else
        Form1.SSTab1.Tab = "1"
        
        Form11.Show vbModeless, Me
        
        Form10.Hide
        Form12.Hide
        Form13.Hide
        Form14.Hide
        
       For aa = 0 To Form1.List1.ListCount - 1
            Form11.BackGround1(Form11.BackGround1.Count - 1).ZOrder "0" = Form1.List1.ItemData(Form1.List1.ListIndex)
       Next
    End If
      
    End Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  36. #36
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    I still don't understand but here is some code that may help you. Click on Command1 to create some listbox's in thepicturebox. Click on one of them, then click Command2 to move the one you just clicked.
    Attached Files Attached Files

  37. #37

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    I had a look at the zip file. It only displayed information, about moving controls. That part I have down patt. But I have to fix the reference to the Container. As a single and dynamic control, at run-time and not a design-time.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  38. #38
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    ItemData should be a number. Having said that (at least 3 times), why repeat things you don't have to?


    Code:
    Public Sub List1_Click()
    Dim aa As Long
    
    Form1.SSTab1.Tab = "1"
    
    Form11.Hide
    Form10.Hide
    Form12.Hide
    Form13.Hide
    Form14.Hide
    If Form1.List1.ItemData(Form1.List1.ListIndex) <> 0 Then
       For aa = 0 To Form1.List1.ListCount - 1
            Form11.BackGround1(Form11.BackGround1.Count - 1).ZOrder "0" = Form1.List1.ItemData(Form1.List1.ListIndex)
       Next
    End If
      
    End Sub

  39. #39
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Maybe he doesn't understand that there is a difference between 0 and "0". If you put the number in quotes VB will treat it as a String.

    .ItemData = 0

    is not the same as

    .ItemData = "0"

  40. #40
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???

    Quote Originally Posted by ThEiMp View Post
    I had a look at the zip file. It only displayed information, about moving controls. That part I have down patt. But I have to fix the reference to the Container. As a single and dynamic control, at run-time and not a design-time.
    The added Msgbox will show you the container's index.

    Code:
    Private Sub Command2_Click()
    
        List1(CurrentIndex).Move 0, 0
        MsgBox List1(CurrentIndex).Container.Index
    End Sub

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width