combobox

Accessing child of ListBoxItem

我们两清 提交于 2020-01-16 17:59:45
问题 I have a ListBox with a DataTemplate that looks like this: <ListBox Name="listBox"> <ListBox.ItemTemplate> <DataTemplate DataType="x:Type local:NumericIconDefinition"> <Grid> <ComboBox Name="IconComboBox"/> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> I would like to fetch the ComboBox instance in order to manipulate it in the code behind. I found a blog post that explained the process of fetching the ListBoxItem: ListBoxItem lbi = (ListBoxItem)listBox.ItemContainerGenerator

Using RowSource Property to Fill ComboBox in Excel VBA

China☆狼群 提交于 2020-01-16 09:11:29
问题 I am trying to fill a ComboBox with selections equal to the first column of a data table, and keep getting Run-Time error 380 I suppose I could use a loop and AddItem statements, but since I expect this to get large (several hundred entries), would prefer to stay away from loops that might slow down the execution. Any thoughts on what I am doing wrong? Private Sub ClientNameComboxAdd_Enter() Dim sht As Worksheet Dim LastRow As Long, UseRow As Long Dim NameFind As Range Set sht = ThisWorkbook

Xpath table changes as combobox changes too

我与影子孤独终老i 提交于 2020-01-16 09:09:10
问题 I'm working on an application in C# that goes to a website and gets some content out of a table. It's working fine, but here is the problem: the table that I'm getting the content of changes as I select a different value in a combobox. The Xpath that I use always gets the table that is first shown on the website and I don't know how to get the other ones. I'm posting here everything I think is useful for you to help me. The webpage is: http://br.soccerway.com/national/brazil/serie-a/2012

ComboBox自由切换属性DropDown和DropList

余生长醉 提交于 2020-01-16 08:10:43
在ComboBox属性为DropDown情况下,自由切换控件可编辑和不可编辑功能。 原理如下:重写CComboBox,然后新增不可编辑功能即可。方法如下: 1.新增类,CMyComboBox,选择继承自CComboBox; 2.在CMyComboBox.cpp,重载ON_WM_CTLCOLOR; 3.在CMyComboBox.h中,增加变量CEdit m_edit ; bool bDropDown; 4.在重载的OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 添加代码 HBRUSH CMyComboBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor); // TODO: Change any attributes of the DC here if (true==bDropDown)//当需要对编辑框操作是,将其至为true { if (m_edit.GetSafeHwnd() == NULL) m_edit.SubclassWindow(pWnd->GetSafeHwnd()); if (nCtlColor == CTLCOLOR_STATIC) { m

ChoiceBox with custom Item in a TableView

假如想象 提交于 2020-01-16 05:47:22
问题 I have a private TableView<Indicators> tableviewIndicators; with column private TableColumn<Indicators, WindowsItem> tablecolumnFrame; public static class WindowsItem { CustomInternalWindow chrt; private WindowsItem(CustomInternalWindow _chrt) { chrt = _chrt; } public String toString() { return chrt.getTitle(); } } private Indicators(String tl, WindowsItem chrt, String pne, Boolean sel) { this.tool_col = new SimpleStringProperty(tl); if (chrt == null) { this.chart_col = new

Combobox Dataprovider - Only gets labelField from XML not the associated ID

血红的双手。 提交于 2020-01-16 05:16:06
问题 Back again this time working with data providers. Well i been doing a bit of training with Flex, and I've searched, and i managed to get a ComboBox being populated through XML data. Its works pretty well, he gets the LabelField for each item from XML, but the ID associated to each item he doesn't get then from the XML. Code: <?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="355" height="465" creationComplete="getPaises

Itext combobox, width of selected option issue

寵の児 提交于 2020-01-16 04:58:08
问题 I have a problem with using Itext pdf. The problem is, after an option is selected and the pointer is focused on another element of pdf, the text in TextField is somehow cut off or some letters are floating over. What would be the solution? The image that shows what's going on Chunks of the code are @Override public void writePdfElement(RankingQuestionDTO input, Document document, PdfWriter writer, PdfPTable baseTable) { try{ PdfPTable table = new PdfPTable(2); PdfPCell cell; document.add(new

Action listener on comboBox to display selection in textField

倾然丶 夕夏残阳落幕 提交于 2020-01-16 00:40:34
问题 I have a comboBox that contains selections. I am trying to apply an actionListener to display te selected string on a textField. I am not sure how to complete this and all I have read is confusing me even more. Here is the code for the comboBox: JComboBox comboBox = new JComboBox(); comboBox.setModel(new DefaultComboBoxModel(new String[] {"Select Something", "Selection 1", "Selection 2", "Selection 3", "Selection 4"})); panelTop.add(comboBox); comboBox.setPreferredSize(new Dimension(160, 20))

vb.net combobox population getting index of the 1st combobox

两盒软妹~` 提交于 2020-01-15 23:41:07
问题 I populated my combobox1 with this code in load sql = "select name1,id1 from table1" da = New Odbc.OdbcDataAdapter(sql, con) da.Fill(ds, "cbtbl1") ComboBox1.DataSource = ds.Tables("cbtbl1") ComboBox1.DisplayMember = ds.Tables("cbtbl1").Columns("name1").Caption I have my 2nd combobox2 related to combobox1. I inserted this code in combobox1 selectedvaluechanged . This to change to value of combobox2 based on their related ids sql = "select name2,id2 from table2 where id1=" & ??????? da = New

select one value of checkboxCombobox

三世轮回 提交于 2020-01-15 15:30:24
问题 i am using several checkboxcomboboxes. for my sollution one of these boxes needs to behave as a combobox in a specific situation. i need to select one value only. i tried the following: private void PreDefSerials_SelectedValueChanged(object sender, EventArgs e) { if (!one_select) return; else { // set selected value if (PreDefSerials.SelectedIndex != 0) PreDefSerials.CheckBoxItems[PreDefSerials.SelectedIndex].CheckState = CheckState.Checked; return; } } EDTI: how can i set all the