Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
Thanks, but I am getting very tired!! It's showing. I am now at: 0555 hours (05:55 AM) and I haven't slept all night and all morning. So can we do this again, some other time???
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
Okay, I'm back in the thick of it!!
I guess and ready to take it on again!!
Problem: Still the same, and YES!! Removed all " from the values, instead of the TextBoxes, which I capture data into to make my project work. Hence, the If Form1.Text2.Text = "0" Then, etc.... (Now only my AddItems, Captions and Text properties have " in them, that point to Strings, instead of values.)
Another Problem: Coming up against the Coding Section. The text data doesn't stay on the same line or cursor position, when entering in code!! But that is for another time!!
My source code, now looks like this. I am getting a process problem. That is like this: It goes to the end of .Count, but when required to go backwards into the .Count. Problems arise!!
They are as follows: They don't go back, they stay at the last created PictureBox and no matter what don't change. For any amount of code, I input into it!!
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
Form1.Label3.Caption = "Form" & (Form11.BackGround1.Count - 1)
Form11.TitleBar_FormCaption1.Caption = "Form" & (Form11.BackGround1.Count - 1)
Form11.BackGround1(Form11.BackGround1.Count - 1).Visible = True
Next
End If
End Sub
1 Attachment(s)
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
This can not be put simpler than the codes attached...
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
Thanks for all of your help. I now, understand values and strings, alot more now!!
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
Problem: I found something about my project, when it executed in the compiled format of the project. It says that it cannot find Control Array item: "5". I know that, cause item "5", is made using a control array. And that the .ItemData = .ItemData + 1. It's execution value is 0, but then when it comes to that part of the code. It is value + 1. So then it will always add + 1 to the value, everytime is is run that block of code.
I get this error, after the control array to make the PictureBox, is executed. It is loaded fine, but then afte that my project crashes and then it says; as above in the problem statement block of this post.
Resoultion: I must have some error checking in the project, in that part of the code. To make it continue when there isn't as yet, an item "5".
-- How do I come up with a solution to my problem??? With my education of programming in COM, I say that I must go and do some error, checking. So the next few people, that read this post. Could you please, give me so source code, in order to do some error checking, in the process of my code below.
Thanks in advance...
Code:
Public Sub List1_Click()
If Form1.List1.ItemData(Form1.List1.ListIndex) = 0 Then
Form1.SSTab1.Tab = 1
Form11.Hide
Form10.Hide
Form12.Hide
Form13.Hide
Form14.Hide
Else
Form1.SSTab1.Tab = 1
Form11.Show vbModeless, Me
Form10.Hide
Form12.Hide
Form13.Hide
Form14.Hide
Form11.BackGround1(Form1.List1.ListIndex).Visible = True
Form11.BackGround1(Form1.List1.ListIndex).ZOrder 0
End If
End Sub
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
When you say "It says that it cannot find Control Array item: "5". I know that, cause item "5", is made using a control array. And that the .ItemData = .ItemData + 1." are you talking about two control arrays or just one?
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
One control array of PictureBoxes. And a ListBox, made a design-time that has some data filled at design-time. And then some data that is filled in a run-time. The ListBox reads the .ItemData, of the PictureBoxes.
Re: If List1.ItemData = "1" Then Form11.Picture1(l).Visible = True???
I am getting conflicting processes: Most probably in this position???
Code:
Form1.List1.AddItem "Form" & l & ":" & " " & Filename & ".frm"
Form1.List1.ItemData(Form1.List1.NewIndex) = Form1.List1.ItemData(Form1.List1.NewIndex) + 1
-- Also this found on the Form2.Command1_Click() handler.