[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

API StatusBar on UserControl

Leo

8/19/2011 8:23:00 AM

I am trying to draw a StatusBar with CreateWindowEx on a UserControl
with the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it
something to do with the UserControl not being resizeable?

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


7 Answers

Karl E. Peterson

8/19/2011 6:43:00 PM

0

Leo explained on 8/19/2011 :
> I am trying to draw a StatusBar with CreateWindowEx on a UserControl with the
> style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something to do
> with the UserControl not being resizeable?

You might find this useful... http://vb.mvps.org/sampl...

--
..NET: It's About Trust!
http://vfre...


Abhishek

8/20/2011 5:25:00 AM

0

ucStatusbar
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=56837&am...


--
abhishek
http://vb6zone.bl...


"Leo" <ttdhead@gmail.com> wrote in message
news:j2l6fr$9g3$1@dont-email.me...
|I am trying to draw a StatusBar with CreateWindowEx on a UserControl
| with the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it
| something to do with the UserControl not being resizeable?
|
| --
| ClassicVB Users Regroup! comp.lang.basic.visual.misc
| Free usenet access at http://www.eternal-sep...
|
|


(nobody)

8/20/2011 12:02:00 PM

0

"Leo" <ttdhead@gmail.com> wrote in message
news:j2l6fr$9g3$1@dont-email.me...
>I am trying to draw a StatusBar with CreateWindowEx on a UserControl with
>the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something
>to do with the UserControl not being resizeable?

Why are you not using the StatusBar control?

Anything that is created using the API function CreateWindow(Ex) will not
cause Validate event to fire in other controls when you click the
API-created control, and pressing Tab would skip the API-created control. If
you want Validate event and Tab to work, you have to apply
IOLEInPlaceActiveObject trick so VB can "see" the control. Search the web
for "vb IOLEInPlaceActiveObject" for a solution.

If the reason for creating the control using the Windows API is so you can
specify certain styles which can only be specified at the time the control
is created, then there is another way. Some styles cannot be changed after
the control is created, so they have to be specified in the call to
CreateWindow() or by intercepting WM_CREATE and modifying the parameters
that were passed to CreateWindow(). The sample below shows how to do the
later. See fAppHook() function:

http://www.thescarms.com/vbasic/Owner...

Here is another sample that turns VB's ListView into a Virtual ListView by
enabling LVS_OWNERDATA:

http://www.mvps.org/vbvision/Sample_Projects.htm#Virtual_Lis...

Make sure that you are looking at "Virtual ListView Demo.zip (19KB)", and
not "Virtual Listbox Demo.zip (34KB)".


Karl E. Peterson

8/22/2011 5:51:00 PM

0

Nobody wrote :
> "Leo" <ttdhead@gmail.com> wrote in message news:j2l6fr$9g3$1@dont-email.me...
>>I am trying to draw a StatusBar with CreateWindowEx on a UserControl with
>> the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something
>> to do with the UserControl not being resizeable?
>
> Why are you not using the StatusBar control?
>
> Anything that is created using the API function CreateWindow(Ex) will not
> cause Validate event to fire in other controls when you click the API-created
> control,

Rhetorical question... Would you *want* Validate to fire, if the user
is merely resizing the window?

> and pressing Tab would skip the API-created control.

Likewise, I've never seen a statusbar or sizer grip that took focus.
Seems like an odd warning.

--
..NET: It's About Trust!
http://vfre...


Leo

8/23/2011 9:40:00 AM

0

Karl E. Peterson expressed precisely :
> Nobody wrote :
>> "Leo" <ttdhead@gmail.com> wrote in message
>> news:j2l6fr$9g3$1@dont-email.me...
>>>I am trying to draw a StatusBar with CreateWindowEx on a UserControl with
>>> the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something
>>> to do with the UserControl not being resizeable?
>>
>> Why are you not using the StatusBar control?
>>
>> Anything that is created using the API function CreateWindow(Ex) will not
>> cause Validate event to fire in other controls when you click the
>> API-created control,
>
> Rhetorical question... Would you *want* Validate to fire, if the user is
> merely resizing the window?
>
>> and pressing Tab would skip the API-created control.
>
> Likewise, I've never seen a statusbar or sizer grip that took focus. Seems
> like an odd warning.

Was thinking that too.

--
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Free usenet access at http://www.eternal-sep...


(nobody)

8/23/2011 9:57:00 AM

0

"Karl E. Peterson" <karl@exmvps.org> wrote in message
news:j2u4u0$cga$1@dont-email.me...
> Nobody wrote :
>> "Leo" <ttdhead@gmail.com> wrote in message
>> news:j2l6fr$9g3$1@dont-email.me...
>>>I am trying to draw a StatusBar with CreateWindowEx on a UserControl with
>>>the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something
>>>to do with the UserControl not being resizeable?
>>
>> Why are you not using the StatusBar control?
>>
>> Anything that is created using the API function CreateWindow(Ex) will not
>> cause Validate event to fire in other controls when you click the
>> API-created control,
>
> Rhetorical question... Would you *want* Validate to fire, if the user is
> merely resizing the window?
>
>> and pressing Tab would skip the API-created control.
>
> Likewise, I've never seen a statusbar or sizer grip that took focus.
> Seems like an odd warning.

I meant this in the general case with API-created controls. I didn't have
time to test if the StatusBar gets focus. From a quick test with the one
that comes with VB6, it seems it causes Validate to fire on other controls,
but the focus never leaves that control, so Validate fires again when you
tab to another control, so it's not a big issue.


Karl E. Peterson

8/23/2011 9:10:00 PM

0

Nobody wrote :
> "Karl E. Peterson" <karl@exmvps.org> wrote...
>> Nobody wrote :
>>> "Leo" <ttdhead@gmail.com> wrote...
>>>>I am trying to draw a StatusBar with CreateWindowEx on a UserControl with
>>>> the style SBARS_SIZEGRIP. The sizegrip is not showing up. Is it something
>>>> to do with the UserControl not being resizeable?
>>>
>>> Why are you not using the StatusBar control?
>>>
>>> Anything that is created using the API function CreateWindow(Ex) will not
>>> cause Validate event to fire in other controls when you click the
>>> API-created control,
>>
>> Rhetorical question... Would you *want* Validate to fire, if the user is
>> merely resizing the window?
>>
>>> and pressing Tab would skip the API-created control.
>>
>> Likewise, I've never seen a statusbar or sizer grip that took focus. Seems
>> like an odd warning.
>
> I meant this in the general case with API-created controls.

Agreed, those are valid concerns in the general case.

--
..NET: It's About Trust!
http://vfre...