Home > Software engineering >  About in CMFCPropertyGridProperty ComboBox dropdown box
About in CMFCPropertyGridProperty ComboBox dropdown box

Time:10-11

CMFCPropertyGridProperty selected item properties for the ComboBox, wants to control property entry via keyboard Alt + left ComboBox dropdown box, according to
Going to code between the===to join, but checked some data, from the prop to ShowDropDown (BL_TRUE) transition,
Hope friends to help, thank you for your guidance,
The switch (MSG - & gt; Message)
{
Case WM_SYSKEYDOWN:
If (: : GetKeyState (VK_MENU) & lt; 0)
{
Char key=static_cast & lt; char> (MSG - & gt; WParam);
The switch (key)
{
Case VK_DOWN:
CMFCPropertyGridProperty * prop=CMFCPropertyGridCtrl: : GetCurSel ();
If (prop==nullptr) break;
if(! Prop - & gt; IsAllowEdit ())
{
======================================================

======================================================
}
}
}
break;

Case WM_KEYDOWN:
The switch (MSG - & gt; WParam)
{
Case VK_TAB:
CMFCPropertyGridCtrl: : SendMessageW (WM_KEYDOWN, VK_DOWN);
Return BL_TRUE;
Default:
Return CMFCPropertyGridCtrl: : PreTranslateMessage (MSG);
}
break;
}

Return CMFCPropertyGridCtrl: : PreTranslateMessage (MSG);

CodePudding user response:

Capture keyboard message this press ALT + up key trigger your next pull

The virtual keys (VK_ *)

On each key corresponding to a keyboard scan code, scan code is set by the OEM, different manufacturers as a keyboard scan code button, there is may appear inconsistent situation, in order to get rid of the situation due to inconsistent system equipment, through the keyboard driver will scan code mapping virtual key code for the unity, said to all the equipment have a unified virtual keys, such as the enter key is VK_RETURN virtual key,

Windows of the definition of virtual keys are defined in WinUser. H this header file, are VK_ prefix,

CodePudding user response:

SWWLLX thank you for your reply, but didn't quite understand your meaning, this code is to capture the keyboard messages above, through the keyboard down Alt + key to implement CMFCPropertyGridProperty ComboBox attribute items in a drop-down box display,
May be I didn't express clearly, I'm sorry,
A ProtertyGrid can more than one Property, a Property can have more than one Item, a Item by definition can be Edit, can be a ComboBox,
ShowDropDown function called for general ComboBox control, can under the drop down box pops up,
In the code CMFCPropertyGridProperty * prop=CMFCPropertyGridCtrl: : GetCurSel (); Can get the current selected item attributes, but now I don't know by what methods can be invoked from prop to effective ShowDropDown,
Want to experience guidance, thank you
  • Related