The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Resource DLL and List Box Selection Property

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cdrozdowski111 Posted - 08/10/2013 : 12:16:17 PM
OriginPro 9.0.0 SR2 64-bit, Win7 64-bit, running in VMware Fusion 5.0.3

Hello,

I created a dialog resource DLL in Visual Studio 2010. It contains a list box. How can I change the "Selection" (Single, Multi, etc) property of the list box in my Origin C dialogOnInit() function? And what might be any constants for the types of selections (if there are any)?


BOOL dialogOnInit()
{	...
	m_lbList = GetItem(IDC_FILTERED_LIST_BOX);
	...
}

...

private:
	ListBox m_lbList;

4   L A T E S T    R E P L I E S    (Newest First)
cdrozdowski111 Posted - 08/14/2013 : 07:15:13 AM
Penn,

Based on some Googling, I found various (albeit unofficial and dated) references that say you can't change that particular style after the control has been created.

One suggestion that is a bit ungraceful but would work is to create 2 stacked list boxes on the form. One with multiselect, one without. And then switch the visibility. For example (untested code):


BOOL dialogOnInit()
{
...

// Toggle visibility and assign proper listbox to class member
if (multi == true)
	GetItem(IDC_LIST_BOX_SINGLE).Visible == false;
	m_lbList = GetItem(IDC_LIST_BOX_MULTI);
	m_lbList.Visible == true;
}
else
{
	GetItem(IDC_LIST_BOX_MULTI).Visible == false;
	m_lbList = GetItem(IDC_LIST_BOX_SINGLE);
	m_lbList.Visible == true;
}
...

private:
	ListBox m_lbList;

Penn Posted - 08/13/2013 : 9:43:01 PM
Hi,

There should be methods ModifyStyle and ModifyStyleEx available for such purpose with LBS_MULTIPLESEL = 0x0008L, however, I have tried, there is a bug there. I have added this bug to our bug-trace database. Sorry for that.

Penn
cdrozdowski111 Posted - 08/13/2013 : 06:03:43 AM
ListBox::SetSel( int nIndex, BOOL bSelect = TRUE ) is not what I need. That particular method sets which individual item(s) in the list box are selected.

In Visual C++ 2010, the property dialog allows the "Selection" property of a list box to be set to: Single, Multiple, Extended or None (see the attached screenshot). That is what I'd like to be able to change in my code. There is no reference to this in either the OC docs or any code.

Iris_Bai Posted - 08/13/2013 : 03:24:50 AM
Hi,

Please use ListBox::SetSel( int nIndex, BOOL bSelect = TRUE ).

To find more member functions, in Origin Code Builder Edit window, you can put cursor on ListBox and press F1 key to open Origin C CHM. Choose the 1st row - "ListBox" in Topics Found dialog, click OK button. In the opening page, this is a Members table listed all member functions in ListBox class.

Iris

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000