Click here to Skip to main content
14,546,974 members

C / C++ / MFC

 
AnswerRe: calling another window from dialog box and display data Pin
Vipin Aravind6-Aug-06 2:12
MemberVipin Aravind6-Aug-06 2:12 
GeneralRe: calling another window from dialog box and display data Pin
With_problem6-Aug-06 16:29
MemberWith_problem6-Aug-06 16:29 
AnswerRe: calling another window from dialog box and display data Pin
Hamid_RT6-Aug-06 3:04
MemberHamid_RT6-Aug-06 3:04 
GeneralRe: calling another window from dialog box and display data Pin
With_problem6-Aug-06 16:32
MemberWith_problem6-Aug-06 16:32 
GeneralRe: calling another window from dialog box and display data Pin
Kiran Pinjala6-Aug-06 19:12
MemberKiran Pinjala6-Aug-06 19:12 
GeneralRe: calling another window from dialog box and display data [modified] Pin
With_problem6-Aug-06 19:27
MemberWith_problem6-Aug-06 19:27 
GeneralRe: calling another window from dialog box and display data Pin
Hamid_RT6-Aug-06 19:35
MemberHamid_RT6-Aug-06 19:35 
QuestionHow to disable one button in toolbar [modified] Pin
xuwenq885-Aug-06 18:01
Memberxuwenq885-Aug-06 18:01 
problem is that I want to disable one of buttons in the toolbar,
for example:
I create a toolbar in an application based dialog:

//add a toolbar in a dialog<br />
	if (!toolbar.CreateEx(this,<br />
		TBSTYLE_FLAT|TBSTYLE_TRANSPARENT <br />
		, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, <br />
		CRect(0, 0, 0, 0), AFX_IDW_TOOLBAR) <br />
		||!toolbar.LoadToolBar(IDR_TOOLBAR1) )<br />
	{<br />
		TRACE0("failed to create toolbar\n");<br />
		return FALSE;<br />
	}<br />
<br />
	/////////////adjust it/////////////////<br />
	toolbar.SetButtonText(0," config ");    <br />
	toolbar.SetButtonText(1," connect ");   // ID is IDC_CONNECT<br />
	toolbar.SetButtonText(2," transport ");<br />
	toolbar.SetButtonText(3," disconnect ");<br />
	CRect rc(0, 0, 0, 0);<br />
	CSize sizeMax(0, 0);<br />
	CToolBarCtrl& bar = toolbar.GetToolBarCtrl();<br />
	for (int nIndex = bar.GetButtonCount() - 1; nIndex >= 0; nIndex--)<br />
	{<br />
		bar.GetItemRect(nIndex, rc);<br />
		rc.NormalizeRect();<br />
		sizeMax.cx = __max(rc.Size().cx, sizeMax.cx);<br />
		sizeMax.cy = __max(rc.Size().cy, sizeMax.cy);<br />
	}<br />
	toolbar.SetSizes(sizeMax, CSize(16,15));<br />
        RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);<br />


Now, I want to disable the button , which that ID is IDC_CONNECT, I had mark it , what can I do , how to add codes to change the state of the toolbar's button?

waiting for answers online!


-- modified at 0:02 Sunday 6th August, 2006

Just my interest for these common things

AnswerRe: How to disable one button in toolbar Pin
Steve Echols5-Aug-06 18:25
MemberSteve Echols5-Aug-06 18:25 
AnswerRe: How to disable one button in toolbar Pin
ThatsAlok5-Aug-06 23:52
MemberThatsAlok5-Aug-06 23:52 
AnswerRe: How to disable one button in toolbar Pin
Hamid_RT6-Aug-06 2:43
MemberHamid_RT6-Aug-06 2:43 
GeneralRe: How to disable one button in toolbar Pin
xuwenq886-Aug-06 5:37
Memberxuwenq886-Aug-06 5:37 
QuestionC-CPP PreProcessing Pin
Bram van Kampen5-Aug-06 14:55
MemberBram van Kampen5-Aug-06 14:55 
AnswerRe: C-CPP PreProcessing Pin
Ravi Bhavnani5-Aug-06 17:04
professionalRavi Bhavnani5-Aug-06 17:04 
AnswerRe: C-CPP PreProcessing Pin
Vipin Aravind6-Aug-06 2:21
MemberVipin Aravind6-Aug-06 2:21 
AnswerRe: C-CPP PreProcessing Pin
Stephen Hewitt6-Aug-06 2:54
MemberStephen Hewitt6-Aug-06 2:54 
QuestionCMonthCalCtrl Rendering Problem [modified] Pin
JKallen5-Aug-06 13:44
MemberJKallen5-Aug-06 13:44 
AnswerRe: CMonthCalCtrl Rendering Problem Pin
Bram van Kampen5-Aug-06 16:37
MemberBram van Kampen5-Aug-06 16:37 
QuestionHook procedure ( SetWindowHookEx() ) Pin
Dody_DK5-Aug-06 12:05
MemberDody_DK5-Aug-06 12:05 
AnswerRe: Hook procedure ( SetWindowHookEx() ) Pin
Ravi Bhavnani5-Aug-06 12:59
professionalRavi Bhavnani5-Aug-06 12:59 
AnswerRe: Hook procedure ( SetWindowHookEx() ) Pin
Hamid_RT6-Aug-06 2:54
MemberHamid_RT6-Aug-06 2:54 
AnswerRe: Hook procedure ( SetWindowHookEx() ) Pin
Dody_DK6-Aug-06 12:36
MemberDody_DK6-Aug-06 12:36 
QuestionClass templates Pin
jon-805-Aug-06 9:27
professionaljon-805-Aug-06 9:27 
AnswerRe: Class templates Pin
Michael Dunn5-Aug-06 11:05
sitebuilderMichael Dunn5-Aug-06 11:05 
GeneralRe: Class templates Pin
Jörgen Sigvardsson5-Aug-06 13:17
MemberJörgen Sigvardsson5-Aug-06 13:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.