12/16/2025 2:36:38 PM
|
| |
| slxdeveloper.com Community Forums |
|
| |
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
locking down a TComboBox dropdown
Posted: 10 Dec 08 7:31 AM
|
How do you prevent users from using/typing anything other than what's in the drop down list? Here's why and what I've done so far:
- Set key=0 in the the keypress control. Prevents typing, but users can still paste into the box with ctrl-v or rt-clk mouse paste. Sneeky 'eh? - I would use a picklist, but I change the contents of the dropdown based on the type of user logged in. - Can I / should I create 4 picklists and dynamically change the picklist? Am I overlooking something simple here? Thanks a bunch. v7.2.2:
|
|
|
|
Re: locking down a TComboBox dropdown
Posted: 10 Dec 08 9:58 AM
|
No you are not overlooking something simple....you have to script against it....learned this from SLX Opportunity:SALESPROCESS form.....
0. Set the OnKeyPress event of the combo box.....Key = 0
1A. use the ONDROPDOWN event of the Combo Box for your 'change' action.
1B. for the OnChange I just post a nice MSGBOX and tell them to click on the Drop Down Button and then I close up the view.....too much going on in my form to figure out how to rebuild the combo box on the fly.....your mileage will vary.
2. Set an IsReading variable in the AXFormChange/Opening (I also use a Global Pointer to the ItemINDEX value)
Option Explicit DIM IsReading, gNextPhaseIDX
SUB AXFormChange(Sender) ''handles databinding OnChange versus User Changes IsReading = true gNextPhaseIDX = -1 ''''do stuff, including building up the Combo Box and setting its initial Index ( gNextPhaseIDX in this example)! IsReading = False END SUB
3. Here is the ONDROPDOWN event call
Sub cbNextPhasesONDROPDOWN(Sender) DIM I, ITEMP ITEMP = -100 For i = 0 To SENDER.Items.Count - 1 If SENDER.TEXT = SENDER.Items.Item(i) Then gNextPhaseIDX = i iTemp = i Exit For End If NEXT IF ITEMP < 0 THEN MSGBOX " Do us all a favor and simply select an item from the drop down list" reset the index to 1, gNextPhaseIDX or whatever UNFORTUNATELY YOU MUST rebuild the combo box exit the sub END IF
I did post this on the WISHLIST for SLX.....this has been requested multiple times in the past....
RJ |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|