Print Page | Close Window

Behavior of CommandBarEdit.SetFocus()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=4161
Printed Date: 21 June 2025 at 6:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Behavior of CommandBarEdit.SetFocus()
Posted By: apuhjee
Subject: Behavior of CommandBarEdit.SetFocus()
Date Posted: 07 May 2006 at 2:58pm
I'm not quite sure the behavior I'm getting from the SetFocus() method of a CommandBarEdit control is exactly what should be happening.

The first thing our application does after launching is require a user to sign in. Following good UI practices - since we know that the Username field will need focus, it would be nice for us to do that automatically (think My Yahoo! sign in... 1) launch page 2) type away)

The problem:



It seems that the control is getting focus, but there is no visible caret and typing has no effect. Hitting the tab key once brings us to the desired state, but should that be necessary?

Issue #2 (this is more like a question...)

Is there any control over what toolbar items are shown when the window is not wide enough to show all of them? You can see in the following screenshot that the 'Password' field has been dropped. Since this field is absolutely necessary, it would be nice if I could give it higher priority than the simple tool shortcuts in the toolbar to the left.



See what I mean?

If anyone could advise on either of these issues, it would be greatly appreciated.

Regards ~ jp

-------------
I like mathematics because it is not human and has nothing particular
to do with this planet or with the whole accidental universe — because,
like Spinoza's God, it won't love us in return.



Replies:
Posted By: Oleg
Date Posted: 07 May 2006 at 6:51pm

Hello,

Try Execute for EditControl:

  CommandBars(3).Controls(2).Execute

2.

You can only prevent Wraping at all:

  CommandBars(3).EnableDocking xtpFlagAlignAny Or xtpFlagFloating



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: apuhjee
Date Posted: 07 May 2006 at 7:32pm
Thanks Oleg -

Both solutions work nicely. You are like the Gary Kasparov of programming

The CommandBarKeyDown Event... reference docs don't mention what the behavior of that is for CommanBarEdit / CommandBarComboBox, but it appears to be fired for at least Tab (keyCode = 9) or Enter (keyCode = 13).

Why doesn't this work for the alphanumeric keyCodes? I'd like to prevent the user from using certain keys (i.e. spacebar in password).

Is this possible?

Regards ~ jp

-------------
I like mathematics because it is not human and has nothing particular
to do with this planet or with the whole accidental universe — because,
like Spinoza's God, it won't love us in return.


Posted By: Oleg
Date Posted: 08 May 2006 at 8:42am

Hi,

It will be possible with next release.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net