Drawing pictureboxes over frames[resolved]
hey all,
im having a problem drawing some pictureboxes ontop of frames. i want there to be a line drawn vertically over a frame every 720 units (pixels or twips, dont quite know how its measured). it does that with one exception, the picture box floats over only frame1(2-6), not the first one :confused: . heres my code, if anyone can point out what im doing wrong thatd be awesome. thanx in advance.
attached is a bmp of the form.
note: i took some unimportant code out for clarity.
VB Code:
For cnt1 = 1 To 6
Load Frame1(cnt1)
Frame1(1).Top = 100
Frame1(cnt1).Move 100, Frame1(cnt1 - 1).Top + 500, 15000, 500
Frame1(cnt1).Visible = True
For i = 1 To 20
Load Option1(Option1.ubound + 1)
If cnt1 = 1 Then
Load line1(i)
line1(i).Visible = True
End If
Option1(Option1.ubound).Visible = True
Set Option1(Option1.ubound).Container = Frame1(cnt1)
Next i
Next cnt1
For cnt1 = 1 To 6
Option1(((cnt1) * 20) - 19).Value = True
For i = 1 To 20
If cnt1 = 1 Then
line1(i).Left = i * 720 + 400
line1(i).Width = 15
line1(i).Top = 0
line1(i).Height = 4000
End If
Next
Next
Re: Drawing pictureboxes over frames
Re: Drawing pictureboxes over frames
Control arrays normally start with (0) and not (1). Are you taking that into consideration?
Re: Drawing pictureboxes over frames
yes the first one: frame1(0).visible = false
so yes i am.
p.s. you helped me write some of this code before. thanx again.
Re: Drawing pictureboxes over frames
Oh, I remember this code :)
What kind of a control is your Line1 because a Line object doesn't normally have a Left property?
Re: Drawing pictureboxes over frames
Quote:
Originally Posted by MET777
im having a problem drawing some pictureboxes | the picture box floats over only frame1(2-6)
i am not that dumb, and maybe its just with me, but it seems like you miss stuff alot. ;) neway, i dunno why that is happening. here ill send you the form.
Re: Drawing pictureboxes over frames
What did I miss????? I asked you what kind of control Line1 was (it's not a Line control because Line controls don't have a Left property) but you are trying to do line1(i).Left = i * 720 + 400. Now instead you attach a form that has no line control at all! What am I supposed to do with that???
Re: Drawing pictureboxes over frames
i said it was a picturebox. i just kept the name when i realized a line would not work
ohhh...sry sent wrong form
:o
Re: Drawing pictureboxes over frames
Try this. It's hard to tell exactly what you want so if you need something changed let me know.
VB Code:
Private Sub Form_Load()
Dim cnt1 As Integer
Dim i As Integer
Dim bSkip As Boolean
'counter = 0
'counter2 = 1
bSkip = True
Frame1(0).Visible = True
Option1(0).Visible = True
line1(0).Visible = True
Frame1(0).Move 100, 100, 15000, 500
For cnt1 = 0 To 5 '1 To 6
If cnt1 > 0 Then
Load Frame1(cnt1)
Frame1(cnt1).Move 100, Frame1(cnt1 - 1).Top + 500, 15000, 500
Frame1(cnt1).Visible = True
End If
Select Case cnt1
Case 0
Frame1(cnt1).Caption = "1st String"
Case 1
Frame1(cnt1).Caption = "2nd String"
Case 2
Frame1(cnt1).Caption = "3rd String"
Case Else
Frame1(cnt1).Caption = cnt1 & "th String"
End Select
For i = 0 To 19 '1 To 20
If Not bSkip Then
Load Option1(Option1.UBound + 1)
Option1(Option1.UBound).Visible = True
End If
bSkip = False
Set Option1(Option1.UBound).Container = Frame1(cnt1)
Option1(i + cnt1 * 20).Move i * 720, 200, 200, 200
Next i
Next cnt1
For cnt1 = 0 To 19
If cnt1 > 0 Then
Load line1(line1.UBound + 1)
End If
line1(line1.UBound).ZOrder
line1(line1.UBound).Visible = True
line1(line1.UBound).Left = Option1(cnt1).Left
line1(line1.UBound).Width = 15
line1(line1.UBound).Top = Frame1(0).Top + 80
line1(line1.UBound).Height = 2900
Next
For cnt1 = 0 To 5 '1 To 6
Option1(((cnt1 + 1) * 20) - 20).Value = True
Next
Me.Width = 16000
End Sub
Re: Drawing pictureboxes over frames
hey thanks alot :) i dont know what the zorder thing actually does but i saw it i ure code and put it in mine and now it works great. :) thanx agian
Re: Drawing pictureboxes over frames
ZORDER sets the order in which things are displayed the lower the number (for example 0) the further it is to the front. (0 will bring it to the foremost.) in this case the ZORDER will bring it to actually be visible instead of being hidden behind another control.
Re: Drawing pictureboxes over frames
ohhh.. cool thanx ill have to remember that one