Print Page | Close Window

Setting focus for a button in a command bar

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=8885
Printed Date: 03 March 2025 at 4:40am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Setting focus for a button in a command bar
Posted By: big_red_frog
Subject: Setting focus for a button in a command bar
Date Posted: 25 November 2007 at 7:20pm
Any one have an example of how to set the focus to a particular button in the command bar on creation.
 
I am not a native windows programmer, so it is probably obvious, but ...
 
So this allows me to get the reference for the control I want
 
    CXTPControl *temp = m_wndToolBar.GetControls()->FindControl(xtpControlButton, IDOK, TRUE, FALSE);
 
Looking at temp, I could see it was the correct control.
 
But this doesn't set the focus...
 
    m_wndToolBar.GetControls()->FindControl(xtpControlButton, IDOK, TRUE, FALSE)->SetFocused( TRUE );;
 
Thanks.
 
Otherwise things are going really nice and smooth!



Replies:
Posted By: Oleg
Date Posted: 26 November 2007 at 1:01am
Hi,
 
m_wndToolBar.SetTrackingMode(TRUE, FALSE);
m_wndToolBar.SetSelected(m_nIndex, TRUE);


-------------
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