|
-
May 26th, 2005, 05:08 PM
#1
Thread Starter
Lively Member
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 . 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
Last edited by MET777; May 29th, 2005 at 10:16 AM.
--Matt
-
May 26th, 2005, 06:05 PM
#2
Thread Starter
Lively Member
Re: Drawing pictureboxes over frames
-
May 26th, 2005, 06:10 PM
#3
Re: Drawing pictureboxes over frames
Control arrays normally start with (0) and not (1). Are you taking that into consideration?
-
May 26th, 2005, 06:15 PM
#4
Thread Starter
Lively Member
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.
-
May 26th, 2005, 06:36 PM
#5
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?
-
May 26th, 2005, 06:42 PM
#6
Thread Starter
Lively Member
Re: Drawing pictureboxes over frames
 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.
-
May 26th, 2005, 06:57 PM
#7
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???
-
May 27th, 2005, 07:15 PM
#8
Thread Starter
Lively Member
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
Last edited by MET777; May 27th, 2005 at 07:27 PM.
--Matt
-
May 28th, 2005, 06:05 AM
#9
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
-
May 28th, 2005, 05:09 PM
#10
Thread Starter
Lively Member
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
-
May 28th, 2005, 05:14 PM
#11
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.
-
May 29th, 2005, 10:15 AM
#12
Thread Starter
Lively Member
Re: Drawing pictureboxes over frames
ohhh.. cool thanx ill have to remember that one
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|