|
Saurabh.Garg wrote: 4. 'i' should be capital (upper case.
5. Every parenthesis opened '(' must be closed by a ')' and not a '.'
I agree with your post, but I couldn't resist joking.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
-Saurabh
|
|
|
|
|
void CTestDlg::OnAdd_Click(void)
{
CString strText = _T("");
GetDlgItemText(IDC_EDIT1, strText);
m_ctrlCombo.AddString(strText);
SetDlgItemText(IDC_EDIT1, _T(""));
}
|
|
|
|
|
Try this:
combobox.SetCurSel(-1);
P.S.
I really don't understand people like Saurabh.Garg, I can say they annoy me. The real purpose of this forum is HELPING other people, not insult the way they do with grammar, try asking question in, say Croatian language (I'm from there) and let me laugh to you. The only thing what meters is that we understood each other so we could share our experience, and in that way help someone sometimes. You should not answer others questions if you do not have the answer!!!
|
|
|
|
|
Hi my app is in VS2008 MFC. In InitInstance() I use:
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
But this works only for first time, after (second time I start app) my app window shows in top left portion of my screen.Why? I wont my app to show maximized.
I can delete folder WindowPlacment from Registry then i'ts OK but only for first time again.
What I'm doing wrong here?
Thanks!
|
|
|
|
|
If you know the registry key this is being stored in, then search through the MFC sources to find which function loads this data and uses it, put a breakpoint there, and ride through the debugger till you get to that point.
I bet one of the functions you go through is over ridable, so you can remove that behaviour.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
I need to make combobox as readonly, but i didn't find any method like SetReadOnly() as in CEdit Class.
|
|
|
|
|
Is your combo box needing the "Drop List" style? (Check out the properties)
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
|
If it is a drop list, it is already read only. What are you looking for?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: What are you looking for?
Hot jalebis?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I need to restrict the user from selecting from list in some cases. So i want to make it as readonly.
|
|
|
|
|
I think that you are wanting to disable the control. In that case, use this call: m_list.EnableWindow(false); where m_list is a control variable of your combo box control.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
No. If i need to use EnableWindow() then i wouldn't have raised this question.
Let us consider the following
CEdit m_MyEditCtrl;
m_MyEditCtrl.SetReadOnly(TRUE);
m_MyEditCtrl.Enable Window(FALSE);
Would the about two stmts are same? please answer.
|
|
|
|
|
Edit control has a ReadOnly() method, because the user can type in some text. But the combo box (drop list style) just has a list of options to offer, from which the user can select one (he cannot modify anything, so there's no need for a ReadOnly() method).
Now, what you want the user "NOT" to do with your combo box?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
I want the User to not to select any option from combo box but he can view.
It shouldn't be done through Enablewindow(false).
Because disabling means its not used at all.
|
|
|
|
|
RSAK wrote: I want the User to not to select any option from combo box but he can view.
In that case don't use a Combo box. Use a list box or list control.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
At last i am happy to explain the real problem.
But someone have not understood it properly and giving different explanation to it.
|
|
|
|
|
RSAK wrote: But someone have not understood it properly and giving different explanation to it.
Are you talking about Iain? Nobody can understand your problem properly until *you* explain it properly. If there's a fault, it's yours, please.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
Yes. I still confused with the following answer given by him.
void CTestDlg::OnList_SelChange(void)
{
int iIndex = 0;
iIndex = m_ctrlList.GetCurSel();
if(iIndex == LB_ERR)
{
return;
}
if(iIndex == 3)
{
m_ctrlList.SetCurSel(-1);
}
}
|
|
|
|
|
|
But on friday i have seen his Iain name in that post .
|
|
|
|
|
No. If i need to use EnableWindow() then i wouldn't have raised this question.
Let us consider the following
CEdit m_MyEditCtrl;
m_MyEditCtrl.SetReadOnly(TRUE);
m_MyEditCtrl.Enable Window(FALSE);
Would the above two stmts are same? please answer.
|
|
|
|
|
Please stop spamming. I've answered this question here[^]. Here's another chance to express yourself better: What exactly is that you want to do?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Visual C++ MVP
|
|
|
|
|
void CTestDlg::OnList_SelChange(void)
{
int iIndex = 0;
iIndex = m_ctrlList.GetCurSel();
if(iIndex == LB_ERR)
{
return;
}
if(iIndex == 3) // Suppose you do not want to select fourth item
{
m_ctrlList.SetCurSel(-1);
}
}
|
|
|
|