我自己的组合框问题 [英] my own combo box problem

查看:58
本文介绍了我自己的组合框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我创建了自己的组合框
使用编辑框,向下箭头按钮和列表控件
列表控件的内容就像
+ Type1
+ Type2
-Type3
名称1
名称2
+ Type4

当我单击向下箭头按钮时,它将显示列表控件,但是当我单击"+ Type2"标志时,它将焦点移至该控件在"+ Type2"下面.

在列表控件下面,可能会有一些控件,因此当我在列表控件中单击时
并且在该项目的下方,如果有任何控件,则焦点将移至该控件,而不是列表控件.

在这种情况下我该怎么办?

当我在列表控件中单击以在其中选择一个项目时,无论是否
,它都应选择该项目 在该点击项下方是否有控件.
该怎么做?

所以我想显示具有组合框列表框之类功能的列表控件.
(当我单击向下箭头按钮时,它正在显示列表控件,但是此列表控件后面有一些控件,因此当在列表控件中选择项目时,焦点将移至列表控件后面的控件
所以我不想要这个,它不应该将控件集中在列表控件后面.我该怎么办?)
等待答案.

Hi all,
i created my own combo box
using edit box, down arrow button and list control
and the contents of the list control are like
+Type1
+Type2
-Type3
Name1
Name2
+Type4

when i click on the down arrow button then it shows the list control but when i click on the ''+ Type2'' sign then it moves the focus to the control below that ''+ Type2''.

below the list control there might be some controls, so when i click inside the list control
and below that item if there is any control then focus moves to that control instead of the list control.

what should i do for this case?

when i click inside the list control to select an item in it then it should select that item irrespective of whether
there is a control below that clicked item or not.
How to do this?

so i want to show the list control having the functionality like list box of the combo box.
(when i click on the down arrow button it is showing the list control but there are some control behind this list control so when select the item in the list control then focus moves to the control which is behind the list control
so i don''t want this, it should not focus the control behind the list control. what should i do?)
waiting for the reply.

推荐答案

您需要的东西似乎有点疯狂.因此,这是一个疯狂的解决方案:)

当您单击向下箭头按钮时,u在某些控件rttt ??顶部显示列表框.

因此在那个时候将控件隐藏在列表框下并显示该列表框.

what you require seems to be a bit crazy. So here is a crazy solution to it:)

When you click on the down arrow button, u are displaying the list box on top of some control(s) rttt??.

so at that time hide the control under the list box and show the list box.

MyCRAZYDlg::OnDownArrowBttnClck()
{
.....
GetDlgItem( IDC_MY_CNTRL  )->ShowWindow( SW_HIDE );
GetDlgItem( IDC_MY_LISTBOX )->ShowWindow( SW_SHOW );
.......
}


当您从列表框中选择某项时,您希望将所选项目显示在编辑框中并隐藏列表框rttt ??
那时在列表框下显示控件,然后隐藏列表框....


when u select something from the list box you want the selected item to be displyed in the edit box and hide the list box rttt??
at that time show the control(s) under the list box and hide the listbox....

MyCRAZYDlg::OnSelchangeList()
{
.....
GetDlgItem( IDC_MY_CNTRL  )->ShowWindow( SW_SHOW );
GetDlgItem( IDC_MY_LISTBOX )->ShowWindow( SW_HIDE);
.......

}


这篇关于我自己的组合框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆