How to hide usercontrol

S

Steven

Dear All,

I develop a vb usercontrols, When user insert this component at windows form
or powerpoint, I want to know how to hide this usercontrols? this control
has not hide function! I want to use Move function move this control to
screen outside! but this control has not move function, If we use API
movewindow function, How to re-back older position!

anyone tell me how to know it? thanks!

Best Regards
Steven
 
R

Richard Jalbert

Dear All,

I develop a vb usercontrols, When user insert this component at windows form
or powerpoint, I want to know how to hide this usercontrols? this control
has not hide function! I want to use Move function move this control to
screen outside! but this control has not move function, If we use API
movewindow function, How to re-back older position!

anyone tell me how to know it? thanks!

Best Regards
Steven

One method I used was to change itse coordinates so it would be
"off-screen".


**********************************************************************
(e-mail address removed)

Dog thinks: they feed me, they take care of me: they are gods.
Cat thinks: they feed me, they take care of me: I am god.
http://www3.sympatico.ca/richmann/
http://www.geocities.com/richmannsoft/
**********************************************************************
 
M

Michael C

Andy DF said:
Have you tried UserControl1.Visible = False?

The container that holds the control needs to supply the Visible property I
presume. In Steven's case he is using a container that doesn't. In that case
I'd just use an API to show/hide/move it.

Michael
 
J

Jim Carlock

Steven posted (some text edited for readability):
I developed a vb usercontrol. When a user inserts this
component at windows form or powerpoint, I want to
know how to hide the control?

The easiest way involves putting the control inside a Picture
Box control, then exposing the PictureBox methods (.Move,
..Visible, et al as needed) and mapping those exposed
methods to the PictureBox.

'Public subroutine inside control.
'Add height and width if desired to make control resizable.
Public Sub Move(x As Long, y As Long)
Call PictureBox1.Move(x, y)
End Sub

Public Property Get Visible() As Boolean
Visible = PictureBox1.Visible
End Property
Public Property Let Visible(yVisibility As Boolean)
PictureBox1.Visible = yVisibility
End Property

Hope that helps.

Jim Carlock
Post replies to the newsgroup.
 
M

Michael C

Jim Carlock said:
The easiest way involves putting the control inside a Picture
Box control, then exposing the PictureBox methods (.Move,
.Visible, et al as needed) and mapping those exposed
methods to the PictureBox.

I'm not sure that would be the best method though.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top