|
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);
}
}
|
|
|
|
|
Didi you read the subject?
|
|
|
|
|
Did you forget your manners today?
Someone has kindly offered you a direction to look at for a solution, and that's the tanks they get?
You ask how to make the combobox readonly - you're told a drop list *is* read only.
You clarify that you know that, but you don't want the users changing selection.
Someone tells you how to stop that happening, by disabling the control.
You don't want that. You want the user to think "This app is broken. When I click on an item, nothing happens" instead of giving them useful visial cues.
This user shows you how to capture selection changing, and then rejecting it (ok, he made it no selection, but it's not hard to jump to reselecting the item you want), and you be rude to him.
Your's needing another shot of caffeine to withstand ingrates,
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi i am not here to hurt anyone.
sometimes my questions may lead you think like that.
Anyhow answer i got.-:: "Its not possible to make read only as like CEdit".
Thanks.
|
|
|
|
|
RSAK wrote: Hi i am not here to hurt anyone.
I may have been a little harsh... (Shocking, I know).
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi,
My current operating system is Windows Vista. Earlier my application used to run in Windows 2003. We have a place where some settings are written to HKEY_LOCAL_MACHINE . Now in Windows Vista a non administrative user cannot write anything to registry. We have a proposal to write some settings to ini file. But Vista doesn't have a ini file. So I need to create a private ini file or else some other file and move those settings to this ini file. Can someone send me a code snippet for creating and writing to a private ini file. This file should be independent from one terminal services session to another.
Thanks,
Venkat
|
|
|
|
|
In Vista you can still write to registry but you have to use HKEY_CURRENT_USER.
For ini files I use CIni[^].
-Saurabh
|
|
|
|
|
I'm surprised you didn't have this problem before under windows XP when your users ran as a non-administrator.
What do you say? You required your users to make themselves vulnerable to messing up their system by visiting one bad website?
Shame on you sir!
/rant over.
Can you not change the permissions on the few registry keys you need to get access to? I'd need to check on vista at home, but regedt32 (rather than regedit) will let you do this.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hello everyone,
When open or delete a file (or something else) by a handle, there is error like the handle is occupied by some other parties.
My question is, what is the general technique or tools to find out which process occupies the handle?
thanks in advance,
George
|
|
|
|
|
Im not sure do you need to GetModuleFileName?
|
|
|
|
|
No Hamid,
I do not mean to get the name of the handle, but mean to get the name of the module/binary which holds the handle. Any ideas?
regards,
George
|
|
|
|
|
|
Thanks Naveen,
I have tried to install this tool, but it seems it only works for Windows XP and Windows Vista from error message box?
I need to debug on Windows Server 2003. Any ideas?
regards,
George
|
|
|
|