Overlaying one control with another for GUI 
Author Message
 Overlaying one control with another for GUI

Hi

This is a bit of tricky problem so rather than get too specific as to the
controls that I'm using, I just want to describe the basic scenario and see
if anyone has any suggestions.

I've got an ActiveX databound-able Grid control from a 3rd party vendor
which I use in my VB 6.0 SP5 app'n. The grid control raises all the usual
events relating to GUI ( Resize event, MouseUp, MouseDown, DblClick etc.)

What I would like to do is have a simple button control appear in each cell
of a given column of the grid. (Ideally, I would like the button control to
appear to be neatly "embedded" in the cell(s), but I'm not concerned with
intricacies just yet...)

Unfortunately the grid control does not inherently support an embedded
button control or similar. (I think I have seen, somewhere, a grid control
that allows a column-format to be specified as "button" or similar, but I
can't see that anywhere in this control or its documentation.)

Is it possible for me to "overlay" one ActiveX control with another, on the
same form? Or, to be more accurate, what is the simplest approach to this
problem ? I suspect that I may be able to achieve something by writing lots
of code including dynamic control creation, ZOrder statements etc., but
before I get my proverbial hands too greasy, I wonder if there is a
simple/elegant/easy solution that anyone is aware of ?

Any basic ideas, conceptual clues, etc. would be appreciated.

Thanks for your time.

Robert.



Fri, 25 Mar 2005 18:24:51 GMT  
 Overlaying one control with another for GUI

Quote:
> This is a bit of tricky problem so rather than get too specific as to the
> controls that I'm using, I just want to describe the basic scenario and
see
> if anyone has any suggestions.

> I've got an ActiveX databound-able Grid control from a 3rd party vendor
> which I use in my VB 6.0 SP5 app'n. The grid control raises all the usual
> events relating to GUI ( Resize event, MouseUp, MouseDown, DblClick etc.)

> What I would like to do is have a simple button control appear in each
cell
> of a given column of the grid. (Ideally, I would like the button control
to
> appear to be neatly "embedded" in the cell(s), but I'm not concerned with
> intricacies just yet...)

> Unfortunately the grid control does not inherently support an embedded
> button control or similar. (I think I have seen, somewhere, a grid control
> that allows a column-format to be specified as "button" or similar, but I
> can't see that anywhere in this control or its documentation.)

> Is it possible for me to "overlay" one ActiveX control with another, on
the
> same form? Or, to be more accurate, what is the simplest approach to this
> problem ? I suspect that I may be able to achieve something by writing
lots
> of code including dynamic control creation, ZOrder statements etc., but
> before I get my proverbial hands too greasy, I wonder if there is a
> simple/elegant/easy solution that anyone is aware of ?

The tricky part is working out where on the control you want your control to
appear which usually involves digging around with sub-classing.  You can use
the SetParent() API call to drop your control onto another window (This
occasionally this causes VB some problems but as long as you're not doing
anything too fancy with it then you should be fine.)
You can then respond to it's events normally in your own code, it's event
handlers should still fire properly.  Unfortunately there is no easy
solution to this unless the control actually exposes the rectangle where
you'd want to put the control (Grid controls sometimes do this).  You may
want to head over to Http://www.vbaccelerator.com/ or
Http://www.vbthunder.com/ for some examples on user-drawn controls which are
dealt with in a similar way to what you require.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Fri, 25 Mar 2005 22:44:48 GMT  
 Overlaying one control with another for GUI
Mike,

Thanks for your input on this.

You've answered my question in as much as, it looks as though I'm not going
to get there, without resorting to APIs or doing some other pretty serious
stuff. On this occasion I don't think the work will be worth the end result,
so I'll probably just find an alternate way of doing things altogether!

But the info is appreciated nonetheless.

R.



Quote:
> > This is a bit of tricky problem so rather than get too specific as to
the
> > controls that I'm using, I just want to describe the basic scenario and
> see
> > if anyone has any suggestions.

> > I've got an ActiveX databound-able Grid control from a 3rd party vendor
> > which I use in my VB 6.0 SP5 app'n. The grid control raises all the
usual
> > events relating to GUI ( Resize event, MouseUp, MouseDown, DblClick
etc.)

> > What I would like to do is have a simple button control appear in each
> cell
> > of a given column of the grid. (Ideally, I would like the button control
> to
> > appear to be neatly "embedded" in the cell(s), but I'm not concerned
with
> > intricacies just yet...)

> > Unfortunately the grid control does not inherently support an embedded
> > button control or similar. (I think I have seen, somewhere, a grid
control
> > that allows a column-format to be specified as "button" or similar, but
I
> > can't see that anywhere in this control or its documentation.)

> > Is it possible for me to "overlay" one ActiveX control with another, on
> the
> > same form? Or, to be more accurate, what is the simplest approach to
this
> > problem ? I suspect that I may be able to achieve something by writing
> lots
> > of code including dynamic control creation, ZOrder statements etc., but
> > before I get my proverbial hands too greasy, I wonder if there is a
> > simple/elegant/easy solution that anyone is aware of ?

> The tricky part is working out where on the control you want your control
to
> appear which usually involves digging around with sub-classing.  You can
use
> the SetParent() API call to drop your control onto another window (This
> occasionally this causes VB some problems but as long as you're not doing
> anything too fancy with it then you should be fine.)
> You can then respond to it's events normally in your own code, it's event
> handlers should still fire properly.  Unfortunately there is no easy
> solution to this unless the control actually exposes the rectangle where
> you'd want to put the control (Grid controls sometimes do this).  You may
> want to head over to Http://www.vbaccelerator.com/ or
> Http://www.vbthunder.com/ for some examples on user-drawn controls which
are
> dealt with in a similar way to what you require.
> Hope this helps,

>     Mike

>  -- EDais --

>  - Microsoft Visual Basic MVP -
> WWW: Http://EDais.earlsoft.co.uk/





Sat, 26 Mar 2005 04:04:16 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Overlaying one control with another for GUI

2. help Overlaying text box on a Richtextbox control

3. Migrating from a standard VB app (GUI) to WEB (GUI)

4. ANN:WindowsForms GUI Controls Suite

5. Free TILISOFT GUI ActiveX Controls

6. Fantastic ActiveX GUI controls with free demo

7. Advice sought - putting VB active x control in c++ gui

8. Graph/Drawing control for GUI front end (VB/C++)

9. Need to call Print Preview GUI in IE from Web Browser control

10. loop access GUI controls?

11. Using the Timer control from a non-GUI

12. Reusing ActiveX Control/Code in Win GUI/MSIE

 

 
Powered by phpBB® Forum Software