Re: Unexplainable behavior

new topic     » goto parent     » topic index » view thread      » older message » newer message

Mike777 wrote:
> 
> Greg Haberek wrote:
> > 
> > Mike777 wrote:
> > > 
> > > I'm posting this follow up under a new subject because I'm at my wits end
> > > on
> > > this and would like somebody (anybody?) to take another look to see if
> > > anything
> > > pops out.
> > > 
> > > I have a handler for a checkbox onClick event that I want to fire when the
> > > user
> > > clicks on a label to the left of the checkbox.  I would presume this is
> > > fairly
> > > common behaviour.
> > 
> > I'm gonna stop you right there. I don't presume this to be common practice
> > at
> > all. You're kind of re-inventing the wheel here. If you give a CheckBox a
> > title
> > when you create it, that text will appear to the right of the box, and be
> > click-able
> > and trigger onClick (w32HClick) events automatically. I see no sense in
> > creating
> > an additional label to receive the click events. If all you want is to place
> > the label on the left side of the box, just use the BS_LEFTTEXT style.
> 
> Greg,
> 
> I'd be happy to give this a try.  Is there a method whereby I can reset the
> text to appear with respect to the control I already have?  The control is
> referred
> to a number of places in the code and if I delete that control and replace it
> with a new one it will take me quite a while to hunt down all the places that
> the name has to be edited.  I've already tried setting the BS_LEFTTEXT style,
> but it doesn't seem to have any impact on the existing checkbox.
> 
> Thanks
> 
> Mike

Could you post the statements that create the checkbox and the label? That would
help deciding whether your design is weird from Windows' standpoint or not.

In case this is the issue, a checkbox comes with a label already. By default, it
displays on the right of the small square, and you can switch it to the left as
Greg mentioned. Did you, by any chance, create the checkbox with an empty caption
and then a label to hold the text? This is usually uselessly complex, set the
checkbox caption instead.

btw Derek: setCheck() only sends the BM_SETCHECK message to the button, which
has no effect other than toggling the check mark, assuming the style of the
button defines any.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu