Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Controls / July 2008



Tip: Looking for answers? Try searching our database.

combobox hover style

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christiano - 27 Jun 2008 20:39 GMT
Hi...

i'm creating an user control where there is a flexgrid.

i need this flexgrid to hover over the other objects and even the form
border, just like the combobox list..

is it possible...

tks...

ps: i'm using vb6.
senn - 28 Jun 2008 12:30 GMT
> Hi...
>
[quoted text clipped - 8 lines]
>
> ps: i'm using vb6.

Place it on it's own form of same size as the Combo.
Use the SetWindows api setting it topmost. Make
it resizeable to follow the Combos dropDown method.
Christiano - 01 Jul 2008 18:29 GMT
Tks a lot...

Just 1 more question... How can i retrieve the Left and Top of the user
control on the parent form?

I need to position it under the user control text box...

I've been strugling with it for about 4h now...

>> Hi...
>>
[quoted text clipped - 12 lines]
> Use the SetWindows api setting it topmost. Make
> it resizeable to follow the Combos dropDown method.
Christiano - 01 Jul 2008 18:29 GMT
Tks a lot...

Just 1 more question... How can i retrieve the Left and Top of the user
control on the parent form?

I need to position it under the user control text box...

I've been strugling with it for about 4h now...

>> Hi...
>>
[quoted text clipped - 12 lines]
> Use the SetWindows api setting it topmost. Make
> it resizeable to follow the Combos dropDown method.
senn - 01 Jul 2008 20:17 GMT
> Tks a lot...
>
[quoted text clipped - 4 lines]
>
> I've been strugling with it for about 4h now...

Sounds a bit strange what you say.
The form is a container for the TextBox control.
(wasn't it a ComboBox -last time). You're placing
the control on the form. The TextBox.Left and
TextBox.Top are measured relative to the Forms
(containers) ScaleLeft and ScaleTop in the same
units as the Forms ScaleMode -Twips, Pixel or
whatever you set the ScaleMode to.
So if you set the TextBox.Left and TextBox.Top
to (0,0), then the textBox TopLeft corner lay in
place. First you need to set the forms width and height
to the size you want the TextBox to be. Then you set
the TextBox.Width and the TextBox.Height to the
size of the Form.ScaleWidth and Form.ScaleHeight.
This should be done in code, so you can resize both
as a single unit.

/senn
Christiano - 02 Jul 2008 15:18 GMT
Actually, as Jeff Johnson said, i'm creating a replacement for the combobox,
where the list is a flexgrid control.

The textbox and button are place in an user control (.ctl), and the flexgrid
is placed in a form inside the UC .

i've tried a lot of diferent combinations of code, and none of them worked
out as should...

if my mind ain't tricking me, scaleleft and scaletop returned 0... or
something like it, but the grid where place very far from where it should
be.

tks...

>> Tks a lot...
>>
[quoted text clipped - 23 lines]
>
> /senn
Jeff Johnson - 01 Jul 2008 20:26 GMT
> i'm creating an user control where there is a flexgrid.
>
> i need this flexgrid to hover over the other objects and even the form
> border, just like the combobox list..
>
> is it possible...

If you're saying that you're trying to create a replacement for the combo
box which uses a flexgrid as its dropdown list then you've taken on quite a
task. One of the trickiest things about the combo box is that the dropdown
list has the ability to extend beyond the borders of its parent window,
something that is not normally permitted. To do this you have to fiddle
around with re-parenting the flexgrid while it's displayed. I'm not sure if
there's an article about this on www.vbaccelerator.com or not, but if
something like that is anywhere, that would be the place.

Good luck.
Christiano - 03 Jul 2008 18:22 GMT
hey there...

i found out about the setparent api, and it worked... but i  still cannot
"attach"/ set up the position...

scaleleft and scaletop returns 0... usercontrol.top and usercontrol.top
returns some number that is not the position...

clearing the parent control, i assume that i must get the usercontrol's
absolute position on the window, right??

getwindowrect,maybe? or it does no apply?

tks.

>> i'm creating an user control where there is a flexgrid.
>>
[quoted text clipped - 13 lines]
>
> Good luck.
senn - 04 Jul 2008 08:24 GMT
> hey there...
>
[quoted text clipped - 10 lines]
>
> tks.

You're expressing yourself incoherently. That's why
the answers do not come off.
SetParent API is not used to set positions.
I told you previously how to set controls (TextBox,
Combo, or FlexGrid) - no APIs should be used.
SetWindowPos API is used to set position and order
of a form (a Form-Object).

You'll be best off droping this and be looking after
somthing useable allready made up.

/senn
Christiano - 04 Jul 2008 12:53 GMT
>> hey there...
>>
[quoted text clipped - 23 lines]
>
> /senn

i know that this API doesn't set position... with this API i was able to
make the flexgrid stay over all the elements, and even form borders... just
like the combobox list.
reading what i wrote, i can see that it was realy bad written... all
subjects mixed up...

i had here 2 subjects running.
   1) make the grid hover over the others elements... DONE, clearing the
SetParent API.
   2) set up the grid position in f ( ) of it will always be placed right
under the textbox of the user control.
senn - 04 Jul 2008 14:44 GMT
>>> hey there...
>>>
[quoted text clipped - 35 lines]
>    2) set up the grid position in f ( ) of it will always be placed right
> under the textbox of the user control.

FlexGrid1.Left = TextBox1.Left
FlexGrid1.Top = TextBox1.Top + TextBox1.Height
Christiano - 04 Jul 2008 15:11 GMT
not easy like that...

the flexgrid is place in a separated form...
the form isn't related to the user control, this way, isn't related to the
text box..

the text box is at (0,0) , but the user control where it's placed is in
another position on the mdi child form...
so i must get the user control position to just then place the flexgrid.

scaleleft and scaletop returns 0, both...
usercontrol.extender.left / .top returns some value that is not right...

>>>> hey there...
>>>>
[quoted text clipped - 38 lines]
> FlexGrid1.Left = TextBox1.Left
> FlexGrid1.Top = TextBox1.Top + TextBox1.Height
senn - 05 Jul 2008 00:34 GMT
> not easy like that...
>
[quoted text clipped - 8 lines]
> scaleleft and scaletop returns 0, both...
> usercontrol.extender.left / .top returns some value that is not right...

First, I do not think you should use a MDI-form.
Set position of any forms with below API.
If you are using childforms or forms been set with
SetParent API, SetWindowsPos API won't work
unless using the const SWP_NOZORDER.
-I found out that. Do you have the KPD-Team
API guide, then use the SetParent API as shown
in their example - if you are still using it. But
use below to set positions. When not child forms
change SWP_NOZORDER with SWP_SHOWWINDOW
or SW_SHOWNORMAL.
Course, change 0, 0, Me.ScaleWidth, Me.ScaleHeight
to suite your needs.

/senn

Const SWP_NOZORDER = &H4
Const SW_SHOWNORMAL = 1
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As
Long, _
ByVal cy As Long, ByVal wFlags As Long)

SetWindowPos mWnd, HWND_TOPMOST , 0, 0, Me.ScaleWidth, Me.ScaleHeight,
SWP_NOZORDER
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.