Results 1 to 12 of 12

Thread: Drawing pictureboxes over frames[resolved]

  1. #1

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    Resolved 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:
    1. For cnt1 = 1 To 6
    2.     Load Frame1(cnt1)
    3.     Frame1(1).Top = 100
    4.     Frame1(cnt1).Move 100, Frame1(cnt1 - 1).Top + 500, 15000, 500
    5.     Frame1(cnt1).Visible = True
    6.            For i = 1 To 20
    7.             Load Option1(Option1.ubound + 1)
    8.             If cnt1 = 1 Then
    9.                 Load line1(i)
    10.                 line1(i).Visible = True
    11.             End If
    12.             Option1(Option1.ubound).Visible = True
    13.             Set Option1(Option1.ubound).Container = Frame1(cnt1)
    14.         Next i
    15. Next cnt1
    16.  
    17. For cnt1 = 1 To 6
    18.     Option1(((cnt1) * 20) - 19).Value = True
    19.     For i = 1 To 20
    20.         If cnt1 = 1 Then
    21.             line1(i).Left = i * 720 + 400
    22.             line1(i).Width = 15
    23.             line1(i).Top = 0
    24.             line1(i).Height = 4000
    25.         End If
    26.     Next
    27. Next
    Last edited by MET777; May 29th, 2005 at 10:16 AM.
    --Matt

  2. #2

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    Re: Drawing pictureboxes over frames

    anyone??
    --Matt

  3. #3

  4. #4

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    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.
    --Matt

  5. #5

  6. #6

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    Wink 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.
    --Matt

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

    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???

  8. #8

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    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

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

    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:
    1. Private Sub Form_Load()
    2. Dim cnt1 As Integer
    3. Dim i As Integer
    4. Dim bSkip As Boolean
    5. 'counter = 0
    6. 'counter2 = 1
    7. bSkip = True
    8. Frame1(0).Visible = True
    9. Option1(0).Visible = True
    10. line1(0).Visible = True
    11. Frame1(0).Move 100, 100, 15000, 500
    12.  
    13. For cnt1 = 0 To 5 '1 To 6
    14.     If cnt1 > 0 Then
    15.         Load Frame1(cnt1)
    16.         Frame1(cnt1).Move 100, Frame1(cnt1 - 1).Top + 500, 15000, 500
    17.         Frame1(cnt1).Visible = True
    18.     End If
    19.     Select Case cnt1
    20.         Case 0
    21.             Frame1(cnt1).Caption = "1st String"
    22.         Case 1
    23.             Frame1(cnt1).Caption = "2nd String"
    24.         Case 2
    25.             Frame1(cnt1).Caption = "3rd String"
    26.         Case Else
    27.             Frame1(cnt1).Caption = cnt1 & "th String"
    28.     End Select
    29.     For i = 0 To 19 '1 To 20
    30.         If Not bSkip Then
    31.             Load Option1(Option1.UBound + 1)
    32.             Option1(Option1.UBound).Visible = True
    33.         End If
    34.         bSkip = False
    35.         Set Option1(Option1.UBound).Container = Frame1(cnt1)
    36.         Option1(i + cnt1 * 20).Move i * 720, 200, 200, 200
    37.     Next i
    38. Next cnt1
    39.  
    40. For cnt1 = 0 To 19
    41.     If cnt1 > 0 Then
    42.         Load line1(line1.UBound + 1)
    43.     End If
    44.     line1(line1.UBound).ZOrder
    45.     line1(line1.UBound).Visible = True
    46.     line1(line1.UBound).Left = Option1(cnt1).Left
    47.     line1(line1.UBound).Width = 15
    48.     line1(line1.UBound).Top = Frame1(0).Top + 80
    49.     line1(line1.UBound).Height = 2900
    50. Next
    51.  
    52. For cnt1 = 0 To 5 '1 To 6
    53.     Option1(((cnt1 + 1) * 20) - 20).Value = True
    54. Next
    55. Me.Width = 16000
    56. End Sub

  10. #10

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    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
    --Matt

  11. #11
    Frenzied Member thegreatone's Avatar
    Join Date
    Aug 2003
    Location
    Oslo, Norway. Mhz:4800 x12
    Posts
    1,333

    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.
    Zeegnahtuer?

  12. #12

    Thread Starter
    Lively Member MET777's Avatar
    Join Date
    Apr 2005
    Posts
    76

    Re: Drawing pictureboxes over frames

    ohhh.. cool thanx ill have to remember that one
    --Matt

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