How do I limit typing in a ComboBox Dropdown list

I’ve created a form and added a ComboBox which generated the code:
this->DateList = (gcnew System::Windows::Forms::ComboBox());
this->SuspendLayout();
// DateList
this->DateList->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12,
System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(0)));
this->DateList->FormattingEnabled = true;
this->DateList->Location = System::Drawing::Point(91, 7);
this->DateList->Name = L"DateList";
this->DateList->Size = System::Drawing::Size(121, 28);
this->DateList->TabIndex = 0;
this->DateList->SelectedIndexChanged += gcnew System::EventHandler(this,&Form1::DateList_SelectedIndexChanged);
And then I added some custom code to add the items to the DateList
for ( int x = numSnapShots - 1 ; x >= 0 ; x-- )
  String ^ item = gcnew String ( SnapShots[x]->dateStr );
    this->DateList->Items->Add(item);
this->DateList->SelectedIndex = 0;
All is working fine, I can select any Snapshot date I want from the list. 
The problem is that I can also type anything I want in the ComboBox. 
The dropdown of 12/31/2014 is in the list, but I can also type “Last Year” and of course the code doesn’t know how to handle that.
What item in the combobox do I have the change to what to disable the user’s ability to type in the combobox?

David,
Maybe I didn’t look hard enough, but I could not find a way to create a C# WinForms project and include my existing C++ code as is and then interface the form front end to the existing C++ logic.
I did find relatively easy ways for a C++ CLI Windows Forms Application to communicate with standard C++. 
I had to limit the data types that I passed pack and forth, but the link up was relatively easy.
I have externals in Form1.h which can then simply call the primary C++ interface:
extern std::string str;
extern std::string strPage;
extern std::string strDate;
extern
void Initialize();
extern
int RebuildPage(int);
Initialize() is called right after Initialize Component() to load all the data into memory and build the first HTML page.
if (RebuildPage(7))    
RefreshThePage();
Exists for most of the button clicks and dropdown selections. 
The number tells the C++ code what form control was clicked and a nonzero return tells the form to refresh the page. 
Refresh the page is a simple Form1.h method that does just that, changes the labels on the form header and refreshes the HTML string to the new HTML data created by the C++ logic.
void RefreshThePage(void)
this->webBrowser1->DocumentText =
gcnew String( str.c_str() );
this->ViewLabel->Text =
gcnew String( strPage.c_str() );
this->DateLabel->Text =
gcnew String( strDate.c_str() );
This allowed me to perform all of the complex operation in the existing code with minimal changes, like changing the fprintf’s that created the original HTML files into str.append logic to pass the pages directly to the form.
It’s true that all of my other code was batch style console applications, but the form front end was not totally difficult to learn and the simple fixes like David Lowndes just suggested makes the coding even easier. 
Thanks again Dave.
I created a very complex program to make visualizing mutual fund trends very simple. 
The problem with the batch console application was that if I wanted to stop highlighting symbol ABC and wanted to start highlighting XYZ, I had to modify a data file by hand and then rerun the batch process to recreate the entire website on my local
drive so I could not instantly see the change.  Using a form front end and building and displaying the pages interactively make that process instant.

Similar Messages

  • How to read the selected value of a dropdown list box

    Hello,
    I have 2 custom fields which are of type dropdown list on Accounts(CRMM_ACCOUNT) PCUI application details tab.I need to read the selected value of first dropdown list item,based on that second dropdown list will be populated.
    I know where to populate the dropdown list box,it is in FILL_DROPDOWN_LISTBOX.
    I dont know how to trap the selection made on dropdown list.
    PLease guide me on how to trap the dropdown list field selection value.
    Thanks in advance.
    Thirumala.

    Hello,
    Check what is done in standard for the fielf REGION which is inked to the country.
    Otherwise, you can do the following :
    - in field group customizing, for field 1, flag the 'send request' flag. So, when you change the value in this field via the dropdown, the MAC methods are immediately called.
    - Put the new value in a global variable (GV).
    - in the fill_dropdown_listbox method, get the value from this GV and based on it, filter the values for the dropdown of field 2.
    Hope this will help you,
    Regards,
    Frederic

  • Personas 2.0: How to catch the selection event of a dropdown list?

    Hi Personas 2.0 experts,
    The use case:
    I want to use a text field to show the "key" of an item that can be selected in a dropdown list.
    The issue:
    After clicking the list and selecting an item, the text field is not automatically updated with the newly selected item content.
    Anyone has an idea to how make such an auto update (pls note I don't want to use an extra button to do the update, just by clicking the list only)?
    Thx.
    Dong

    To display the key (the actual value) that's selected in a dropdown, there is a property called ShowKeys which you could set.
    However if you'd want to show the selected value in another field upon picking an option, this would require an event associated in Personas 2.0 with the selection of a dropdown value. This is currently not available so I'm afraid what you are looking for is not possible.
    Edit: It turns out I was wrong... there is an option (at least it's there in SP3) which allows linking a script button to the dropdown property OnValueChanged, so you can use this to do any script action you need when the user selects a value.
    (thanks, Sushant )
    Message was edited by: Tamas Hoznek

  • How to get customizing table entries in to dropdown list

    Hello All,
    I have field in my screen from customizing table. How do i get values in this field when the presses drop down button?
    I know that we can do it by entering fixed values to that field and also when we create a check table we will get values.
    Is there any other way to get the values?
    Can any one help me.
    Regards,
    Lisa.

    Hi,
    I have 2 solutions for your post, one go for DROP DOWN BOX if you are having fixed input values.
    And two go for search help if you want multiple entries has to be displayed in your field form your customized table.
    If you want procedure decide your option and revert me i will send you.
    Good Luck
    Thks

  • How can I use more than 2 dependent dropdown lists

    I would like to create a form using three level of dépendent dropdown lists.
    Some examples exist with States dropdown list depending on a Country dropdown list. I would like to have a third level City depending on the choice made in the second list. Thanks for your help and sorry for my English

    Hi,
    I used the script from http://acrobatusers.com/tutorials/js_list_combo_livecycle1 to create a two dependent drop-downs and then was able to extend this to three dependent drop-down lists. I have put an example up at https://workspaces.acrobat.com/?d=Ph1ZsLxdyeZk9dq9qovNeQ
    Hope this helps,
    Greig

  • How do I display Text linked to a dropdown list selection in a form?

    Ok, I have a form that has a dropdown list with several selections. What I want to have happen is when someone selects one of the options from the dropdown, I want to have text displayed to the right of that information that pertains to that selection.
    I have attached the page with the form I have created as well as the css document that is used.
    Any insight would be most appriciated! Thanks in advance!

    Hi,
    I browsed for you a bit and found this: http://javascript.internet.com/forms/suggest-messages.html Looks like what you need!
    Otherwise just search this database: http://javascript.internet.com/forms/

  • How to extract data from xml field to dropdown list?

    Hi,
    I have designed a form and connected to a SQL server database using a web service. The XML data retrieved from wsdl connection is currently hold in a text field called 'XMLfield'. I need to extract the data such as 'PersonnelName' from XMLfield into a dropdown list. I used the following code and I do not get any error, but nothing come up and all my fields in the forms become bank when i click the dropdown list.
    I would appreciate it if anyone can help me with this issue.
    form1.DropDownList::click - (JavaScript, client)
    xfa.datasets.data.loadXML(form1.XMLfield.rawValue,0,1);
    form1.XMLfield.rawValue = xfa.datasets.data.saveXML();
    var dataGroup = xfa.resolveNode("xfa.data.Timesheet.Personnel.PersonnelName");
    var dataGroupLength = dataGroup.nodes.length;
    if (dataGroupLength == 0) {
      xfa.host.messageBox("There are no parts in the XML doc");
    else {
      for (var i=0; i < dataGroupLength; i++){
        this.addItem(dataGroup.nodes.item(i).nodes.item(0).value);
    Thanks,
    Roya

    Hi Roya,
    I think the loadXML will override your form data, so blanking out your fields.  You could try loading the xml data at the xfa.datasets level (that is xfa.datasets.loadXML(form1.XMLfield.rawValue,0,1);) or using E4X to process the XML.
    Another option though might be more rework is to use the Acrobat SOAP api which will return you a JavaScript object so you wont have to do any XML work.
    There's a good intro to the SOAP api here, http://www.avoka.com/blog/page/11/.
    Regards
    Bruce

  • How to populate a textfield based on a dropdown list and a checkbox

    Hi Guys,
    I need help.
    first step: I have a dropdown list if i click in dropdownlist "a" and put in numeric field a number bigger than 99 the, checkbox should be marked and  second step: a textfield1 should be visible.
    the first step works perfectly but the second doesnt work.
    this is my coding for the second step in event : change java script
    if ((DropDownList1.rawValue == "a") && (this.rawValue == 1))
    TextField1.presence = "visible";
    else
    TextField1.presence = "hidden";
    does anybody have any idea why?
    thanks!!
    Diana

    Hi,
    I would put the following in the exit of the dropdown and the checkbox:
    if 
    (DropDownList1.rawValue == "a" && CheckBox1.rawValue == 1){
    TextField1.presence
    = "visible";}
    else
    TextField1.presence
    = "hidden";}
    (the script is all over the shop, but should be OK in the form).
    Then in the exit event of the numeric field (after the changing of the checkbox value) you could call the checkbox exit event.
    Good luck,
    Niall

  • How to bind a XML file to a dropdown list

    Hello. I am trying to bind a XML file to a dropdown list as taught in the LiveCycle Designer Help. I created a XML file containing the following codes:
    <form>
    <lists>
    <item uiname="MasterCard" token="MC"/>
    <item uiname="Visa" token="VS"/>
    <item uiname="Eurocard" token="EC"/>
    <item uiname="Special Card" token="SC"/>
    </lists>
    </form>
    Then I connected to this XML file, created a dropdown list and then specified its dynamic properties as below:
    However, when previewing this pdf this dropdown list seems empty. Nothing comes out. It seems to me a very basic question but I really need your help. Thanks !
    Also, I would be very appreciated if someone could post me an working example of this.

    Well I found out what was wrong.
    You have to indicate the XML file in the filed "Data File"  of "Preview" in the " Form Properties"....

  • How to Display a Calender upon clicking the dropdown list inside a table co

    Hi,
    I have a Listbox inside my table control and I need to Display a Calender upon clicking the dropdown list.
    Can any body help.
    Srinivas

    Hi,
    Try this:
    On your customizing screen,
    PROCESS ON VALUE-REQUEST.          
        Field T_ZT-SDATE
          module create_dateselect.
    In your main program:
    module create_dateselect.
    data:p_date like sy-datum.
    CALL FUNCTION 'F4_DATE'
       EXPORTING
         holiday_calendar_id = 'CN'                   
         display = ' '
       IMPORTING
         select_date = p_date
       EXCEPTIONS
         OTHERS = 4.
    t_zt-sdate = p_date.
    endmodule.
    Regards,
    Pole

  • How do I customize the Digital Signature Reasons dropdown list?

    I added a Digital Signature field to a pdf file, then added an Action to the field properties for "Mouse Down" to run a JavaScript.
    I am using Acrobat Pro XI.
    Here is the Javascript:
    // Obtain the signature field object:
    var f = this.getField("SigField");
    app.alert("ALERT...ALERT...ALERT...")
    f.signatureSetSeedValue(
    { reasons: ["Reason1", "Reason2"],
    flags: 8
    I included the alert statement just to see if the JavaScript is being executed, and it is.  The alert is displayed.  But, the Reasons field still contains all the default values; it does not contain the specified values ("Reason1", "Reason2").  The name of the digital signature field is "SigField". 
    Why does this JavaScript not work?
    Thank you to anyone who can solve this problem!

    It's not clear to me what you're trying to accomplish. If you get rid of your digital ID you will still be prompted to create/add one when you need to sign a form, which you say you still need to do? Do you really just want to e-sign (hand-drawn signature, or stamp) instead of digitally sign? Do the forms you're using have digital signature fields?

  • How can I sort the Firefox Tools menu dropdown list alphabetically?

    The Tools menu has a dropdown list, but entries are not in alphabetical order. Options and some individual add-ons/extensions show up in the list, but not alphabetically. It would be helpful to have them in alphabetical order in the list, however, I can find no option to sort them. Am I missing some hidden, built-in option for sorting? Is there an add-on perhaps that will provide a sorting means? Anyone have a clue? I haven't found anything in my searches on the topic... just regarding sorting bookmarks. But it is the Tools menu dropdown list I want to be able to tweak. Anyone?

    @ Gingerbread Man....
    Took your suggestion about trying the Menu Editor add-on. So far, it seems to be working. Noted some comments at the add-on's Mozilla page that indicated possible problems with changing the Context menu, and will monitor effects on some changes I made to that menu. But I'm very happy to have been able to re-order my Tools menu drop-down list with this add-on. Thank you so much! God bless!
    PS: Love your username : )

  • ComboBox (dropdown) Need Help Adding URL links!!!

    I am somewhat of a newbie....Anybody know how to use URL
    links in a ComboBox dropdown menu? NEED HELP!!!!!!! I'm trying to
    make it so that after selecting an option, the user is directed to
    another URL within the same browser window. Using flash 8!
    Thanks,

    Im a bit a newbie myslef but i think you make flash
    commuincate to javascript wich will make the browser goto the URL.
    do a search on getURL and javascript together and i am sure
    you will find something.
    And when slecting to redirct i think its on?(onPress)
    something so maybe look throught the help section in flash 8 and
    look at componets. I think there is some actionscript help there.
    Sorry i could not be more helpful.

  • How to print the date in dropdown list if records exceeds 1000 above

    Hi All,
    I have 7000 records in my resultset.
    How to display that much of records in dropdown list.
    I am trying to print ,it takes lot of time for single user.
    is there any alternative for that.

    of course it will take time for the client computer to parse your html.. what you will do is to split you record by hundreds.. you have to consider your clients machine.. not all client has fast computers

  • How to attach value range table to dropdown list box

    Hi there,
    could u please explain me how to attach a value range table to dropdown list box (i.e I/O box with dropdown attribute as list with key).
    if possible please explain me with a sample code.
    Thanks in advance.
    -Tulasi.

    hi ...if the associated domain of the field that u are using as i.o field has value range the same will come as drop down list...u u select the list box option and click from dictionary check box on the attributes...
    To check if the domain has it or not...go to the domain..click on value range..u can see thr,...if values are not thr u can giv the same...
    Or if u are not refering to dictionary type then use fm VRM_SET_VALUes
    reward if the abv is helpful..

Maybe you are looking for