how do I get that? I tried brining it to front, and the other to back, it doesn't work, any other suggestions?
Printable View
how do I get that? I tried brining it to front, and the other to back, it doesn't work, any other suggestions?
For a fast flash:
For a bit of a pause:Code:Do
Label1.Visible = Not Label1.Visible: DoEvents
Loop
Code:Private Declare Sub Sleep Lib "kernel32" _
(ByVal dwMilliseconds As Long)
Do
Label1.Visible = Not Label1.Visible: DoEvents
Call Sleep(100)
Loop
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.
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
Oh! Welcome back "the teenage programmer formerly known as ShadowCrawler"! Long time no see!
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
Try using the .ZOrder property.
Code:Label1.ZOrder = vbBringToFront
ShockWave1.ZOrder = vbSendToBack
acctually what you wanted was:
Code:Private Sub Form_Load()
Label1.ZOrder vbBringToFront
flash1.ZOrder vbSendToBack
End Sub
but it doesn't work
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.
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 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
Good luck!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