|
Hi everybody,
is it possible to get the Default Control of a view?
On a Dialog it works with GetDefID(), but this function doesn't exist for CView
Knows anyone a similar function?
Big thanks!
|
|
|
|
|
GetDefID() just throws a DM_GETDEFID at the window - which a dialog window supports. At best a normal window would just ignore you.
If you just have a CView, which you've messed about a bit, I'm not sure that a default button has any meaning for you.
What kind of view are you using, and what are you actually trying to achieve? And why don't you already know the default window - you created the view, didn't you?
Lastly, BS_DEFPUSHBUTTON is a BUTTON style, not a generic window style, which also limits its usefulness.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi, thanks for your answer.
If you have 3 textboxes and a Button on the Dialog or View, you can switch into them via the Tab-Key.
Tab-Key sets the Focus to the next control and if the user hits the Return-Key, the "Default Button" is clicked.
In my Application it should be different.
You are into the 1. textbox, you enter a string and hit <return>, then the focus switches to the second textbox.
A <return> on the second textbox sets the focus to the third textbox and finally a
return on the third textbox presses the "Default Button"
I have a universal Form which contains a lot of functionalities to all of my views.
Now i added into PreTranslateMessage that a Return on a textbox sets the focus on the next control,
and not a click on the Default Button.
The only thing that i need to know is how i check if the actual textbox is the textbox before the Default Button.
In a Dialog it works with GetDefID() but in my UniView (derived from CFormView) there is no GetDefID()
Don't ask me why the navigation is so unusual
|
|
|
|
|
Hi all,
I have made a Dialog based application in that i have made a picture control in that picture control i am putting a bitmap, that bitmap looks like a banner. Now, what i want is i want to display a button having bitmap on it...
I have done it but it is not displaying, like its displayed when i click on it....
how can i do it...
Thanks in advance
|
|
|
|
|
Does this help [^]
Regards,
Sandip.
|
|
|
|
|
Do you want both bitmap and text?
-@SuDhIrKuMaR@-
|
|
|
|
|
I wouldn't even like to count the number of articles on codeproject about various picture buttons.
Go to the left, click on Desktop Development, then Button Controls, and go wild.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
VCProgrammer wrote: how can i do it...
By reading here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Did you set bitmap field on the property of button?
|
|
|
|
|
Hi all,
In any dialog box i m using diffrent types of control like Editbox,Button,Listctrl etc.
I m using Tabstop function for move one control to another.
But in case of Listctrl when i press tab key to get focus,it get focus but not show now here i can use Up-Arrow and Down_arrow to saw the focus of ListCtrl.
Same condition or Oninitdialog, if the List ctrl is first control of dialog,so when the dialog box is popup the the Listctrl get focus.But it is not happened here also i m use Up and Down arrow key.
Please tell me how can Set focus on tabstop function,or initially for ListCtrl.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
See if CListCtrl::SetSelectionMark()[^] helps you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
No sir its not working, I m also use SetFocus() but it is also not working.
Please tell me another solution.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
The OninitDialog() function should return FALSE, if a control in it want to have focus during startup.
|
|
|
|
|
"_$h@nky_" wrote: No sir its not working, I m also use SetFocus() but it is also not working.
Actually, it does work. But it ain't visible. Try the following code and press up or down key. You'll realize that the focus is on the control.
m_listctrl.SetSelectionMark(0);
m_listctrl.SetFocus();
But, this just works perfect (the selection is visible too):
m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sir i m already mention in my post it works but only with the help of Up and Down Arrow keys.
Otherwise it not visible.
m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
After using this the problem is not solve,it is as it is.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: m_listctrl.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);
m_listctrl.SetFocus();
After using this the problem is not solve,it is as it is.
Strange. Where have you put this code up?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
OnInitDialog() function.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
So, you did not read this post[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
yes read this post and return Flase,but it not working.
It only works with help of up and down arrow key.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you post your entire InitDialog() code?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
m_cListCtrl.SetItemState(nItemToFocus, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_cListCtrl.SetFocus();
-@SuDhIrKuMaR@-
|
|
|
|
|
Does your list control need the LVS_SHOWSELALWAYS style?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can anybody help me in converting an ascii vaue to a binary or hexamdecimal value..
I am using the code below to read from some .dat file in VC++
CFile filename;
filename.open("file_path",CFile::moderead)
CString buffer[10];
for(i=0; i<filename.getlength();i++)>
{
fileName.Read(buffer,1);
//Additional code...
}
The buffer string which i have used to store the values read from the file is coming as ascii values.I want to convert it in to decimal or hecamdecimal values..
The .dat file which i am used as file is some thing like below having hexadecimal values..
AA AA 32 3D...
the asci value of 32 in this case is 2.
in buffer string it is stored as 2 (acsii value of 32).
So i want to get the corrospomding decimal vlaue of '2' in this case it is 50 or the hexadecimal value 32
please help me to solve this.
|
|
|
|
|
Does strtol(..) function helps?
Regards,
Sandip.
|
|
|
|
|
i have tried it..but it is not working..thanks for the reply..
|
|
|
|