Results 1 to 9 of 9

Thread: label on top of flash contorl

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    how do I get that? I tried brining it to front, and the other to back, it doesn't work, any other suggestions?
    NXSupport - Your one-stop source for computer help

  2. #2
    Guest
    For a fast flash:

    Code:
    Do
    Label1.Visible = Not Label1.Visible: DoEvents
    Loop
    For a bit of a pause:

    Code:
    Private Declare Sub Sleep Lib "kernel32" _
    (ByVal dwMilliseconds As Long)
    
    Do
    Label1.Visible = Not Label1.Visible: DoEvents
    Call Sleep(100)
    Loop

  3. #3
    Junior Member
    Join Date
    Feb 2000
    Location
    Gig Harbor, WA, USA
    Posts
    25
    Labels are not allowed to be 'on-top' of other objects. What you can do is make a textbox, set it to BorderStyle = 0, and set the background color to 192,192,192. Fiddle with the Locked property and whatnot to emulate a label.
    (¯`·.¸¸.·´¯`·->Cromas<-·´¯`·.¸¸.·´¯)
    Teenage Programmer
    Formerly known as ShadowCrawler

    E-Mail: [email protected]
    ICQ: 9872708
    AIM: VotchOut

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    I don't think he wanted to flash the label but to put it in front of an other control.

    I'm sorry to disappoint you but you can't!
    A Label is a windowless control. VB draws the text of the caption directly on the form.
    What you can do is to put the label in an other container like a PictureBox.
    Just resize the PictureBox to the size of the label and set the BorderStyle to 0 - None.
    The picture can be placed in front of your flash control.

    Best regards

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Oh! Welcome back "the teenage programmer formerly known as ShadowCrawler"! Long time no see!

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    what I ment was the ShockWave Flash control, not to make the label visible and then not

    a textbox woun't work, what I need is a completely transparnt object to be on top of everything else I was thinking of a transparent form but I would like something else
    NXSupport - Your one-stop source for computer help

  7. #7
    Guest

    I knew that...I was just testing you :)

    Try using the .ZOrder property.

    Code:
    Label1.ZOrder = vbBringToFront
    ShockWave1.ZOrder = vbSendToBack

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    acctually what you wanted was:

    Code:
    Private Sub Form_Load()
       Label1.ZOrder vbBringToFront
       flash1.ZOrder vbSendToBack
    End Sub

    but it doesn't work
    NXSupport - Your one-stop source for computer help

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Well since a label can't be used why don't you create your own user control?
    You want the background to be transparent which makes it a little harder because you can't use the Print statement on a UserControl with a transparent background.
    But it's just a little harder.
    The trick is to use the MaskPicture and MaskColor properties.

    Start a new Active-X Control project and add two picture boxes to the UserControl.
    Set the following properties for PictureBoxes:

    Picture1[*]Name = picMask[*]AutoRedraw = True[*]BackColor = vbWhite[*]BorderStyle = 0 - None[*]Visible = False[/list]Picture2[*]Name = picCaption[*]AutoRedraw = True[*]BorderStyle = 0 - None[*]Visible = False[/list]Now set the following properties for the UserControl
    [*]Name = <Whatever>[*]BackStyle = 0 - Transparent[*]MaskColor = vbWhite[/list]
    Now add the following code to get a Caption property.
    Code:
    Private m_Caption As String
    
    Public Property Get Caption() As String
        Caption = m_Caption
    End Property
    
    Public Property Let Caption(ByVal New_Caption As String)
        m_Caption = New_Caption
        'clear both picture boxes and
        'print the new caption to them
        picMask.Cls
        picMask = LoadPicture()
        picMask.Print New_Caption
        picMask = picMask.Image
        picMask.Cls
        picCaption = LoadPicture()
        picCaption.Print New_Caption
        picCaption = picMask.Image
        'set the MaskPicture and Picture properties
        'of the UserControl
        UserControl.MaskPicture = picMask
        UserControl.Picture = picCaption
        PropertyChanged "Caption"
    End Property
    
    'Load property values from storage
    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
        Me.Caption = PropBag.ReadProperty("Caption", "")
    End Sub
    
    'Write property values to storage
    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
        Call PropBag.WriteProperty("Caption", m_Caption, "")
    End Sub
    The PictureBoxes is never visible but they have to be of the same size as the UserControl. So add the following code in the Resize event.
    Code:
    Private Sub UserControl_Resize()
        picMask.Move 0, 0, ScaleWidth, ScaleHeight
        picCaption.Move 0, 0, ScaleWidth, ScaleHeight
        'call the Property Let Caption procedure to
        'reprint the caption
        Me.Caption = m_Caption
    End Sub
    Good luck!

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