Disable backspace in dgv combobox

I would like to disable backspace and delete in a combo box in a dgv
I used the following
Private Sub frmWorkSelectionPopupAll_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Delete And e.KeyCode = Keys.Back Then
e.Handled = True
End If
End Sub
Delete is disabled, backspace is not.
I have set the form KeyPreview to True.
Can you please suggest something?
John

The options for DisplayStyle are "ComboBox", "DropDownButton" and "Nothing". No luck with any of the 3.
Are you referring to something else?
I tried to replicate the issue by creating an app with a DataGridView and three columns. However I could not EDIT in the ComboBox column anything without using a special Sub routine to do that.
Nothing I tried would let me use the keyboard or mouse to do anything in the ComboBox. Except for using Edit Mode and AutoComplete in which AutoComplete is unecessary in your situation I would imagine. Then I could type a letter while over the ComboBox
and I suppose if something in the ComboBox's list matched it would display. But even then I couldn't backspace or anything else or actually alter text displayed by the ComboBox.
And I believe from this link
Problem with combobox and databound datagridview that this statement is entirely accurate "The ComboBox used by the DataGridViewComboBoxColumn has a DropDownStyle property set to ComboBoxStyle.DropDownList, but DataGridViewComboBoxColumn does
not expose this property, so out-of-box there is no way to type  text into a combobox column."
However at that link is code supplied which can not only provide the ability to edit text in a ComboBox in the ComboBox column but actually add new items to the ComboBox list (or alter it to remove items, whatever) which I used in the below code the Sub
that allows editing text in a ComboBox in a ComboBox column. So unless you are doing something along those lines I really don't know why you are having an issue. Nobody should be able to alter anything in the ComboBox's in the ComboBox column using the keyboard.
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
DataGridView1.ColumnCount = 3
DataGridView1.Columns(0).Name = "Product ID"
DataGridView1.Columns(1).Name = "Product Name"
DataGridView1.Columns(2).Name = "Product Price"
Dim row As String() = New String() {"1", "Product 1", "1000"}
DataGridView1.Rows.Add(row)
row = New String() {"2", "Product 2", "2000"}
DataGridView1.Rows.Add(row)
row = New String() {"3", "Product 3", "3000"}
DataGridView1.Rows.Add(row)
row = New String() {"4", "Product 4", "4000"}
DataGridView1.Rows.Add(row)
Dim cmb As New DataGridViewComboBoxColumn()
cmb.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton
cmb.FlatStyle = FlatStyle.Flat
cmb.AutoComplete = True
cmb.HeaderText = "Select Data"
cmb.Name = "cmb"
cmb.MaxDropDownItems = 4
cmb.Items.Add("Hello")
cmb.Items.Add("Goodbye")
cmb.Items.Add("Seriously?")
cmb.Items.Add("Not")
DataGridView1.Columns.Add(cmb)
End Sub
Private Sub DataGridView1_EditingControlShowing(sender As Object, e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
'Allow user to enter new values for ALL DataGridViewComboBox controls in the DataGridView
If (TypeOf e.Control Is DataGridViewComboBoxEditingControl) Then
Dim cmb As DataGridViewComboBoxEditingControl = CType(e.Control, DataGridViewComboBoxEditingControl)
If Not cmb Is Nothing Then
cmb.DropDownStyle = ComboBoxStyle.DropDown
End If
End If
End Sub
End Class
La vida loca

Similar Messages

  • Disable Backspace Key

    I'm trying to figure out how to disable the backspace key on
    an input form. Or, I need to figure out why I can't type into an
    input field after I've backspaced(erased) all the
    characters?

    Hmmm... I've not seen where you can't type after deleting all
    the
    characters. Do you maybe have the input set to multiline and
    have the top
    line blocked or something? I don't know that there's an easy
    way to disable
    Backspace for an input field.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Anyway to Disable Backspace as a shortcut for going back?

    Sometimes, when posting on a forum like this ... or really anywhere on the web, if I accidently leave a text field (after spending way too much time writing something really witty of course) or accidently hit backspace, Safari 5.03 goes back. I know it's my fault for screwing up, but losing my work over a stupid mistake really *****. Anyway a cluts like me can disable BACKSPACE as a short cut for going back in Safari??? It's driving me nuts, but I don't really want to use IE or any other browser.

    yes (i should have been clearer), with that option set hitting backspace puts you back in a text field (if there is one) instead of going back one page. it should work properly once you've reloaded any pre-existing pages but do let me know if there are cases* where it doesn't.
    *it obviously doesn't work where safari extensions are disabled, like on extensions.apple.com.

  • How can I disable 'backspace' key from navigating back a page?

    Several times over the last couple weeks, I type up a very well thought out response on Facebook in political conversations with friends. An hour or two into my work, I hit backspace with the intent of editing what I wrote (maybe after I scrolled or something, so maybe I unintentionally took the edit window out of focus). The navigator takes me back a page and I lose my two hours of work. Infuriating! Shortcuts with the ability to wipe out two hours of works should be disable-able. Not only that, I feel that is an unsafe shortcut for this very reason, and would have added a SHIFT modifier key or something like that. I think I invented a cool word: disable-able.

    You can set the Integer pref <b>browser.backspace_action</b> to <i>2</i> on the <b>about:config</b> page to disable the backspace action. BTW Shift + Backspace does the reverse: going Forward if possible, so that is taken as well.
    * http://kb.mozillazine.org/browser.backspace_action
    *http://kb.mozillazine.org/about:config

  • Disable Backspace when in input text fields

    Im trying to find a way to disable the keyboard backspace
    button from going back a page in the site but allowing it to
    function as a character delete when needed for typing in an input
    text field of a form.
    Strangely this problem only occurs for about a minute after
    the page is opened....after that it then works correctly. You can
    see what I mean by accessing the site's contact page
    www.safetybusiness.co.uk
    I have found two different sets of code to disable the
    Backspace completely, but this then means it doesn't work at all
    when wanting to delete in the text field.
    Method 1:
    <script type="text/javascript">
    if (typeof window.event != 'undefined')
    document.onkeydown = function()
    if (event.srcElement.tagName.toUpperCase() != 'INPUT')
    return (event.keyCode != 8);
    else
    document.onkeypress = function(e)
    if (e.target.nodeName.toUpperCase() != 'INPUT')
    return (e.keyCode != 8);
    </script>
    Method 2:
    <script>
    function checkShortcut()
    if(event.keyCode==8 || event.keyCode==13)
    return false;
    </script>
    <body onkeydown="return checkShortcut()">
    Anyone know how I can overcome this?

    The TextField class has a tab order property. You may want to
    look into this. As for disabling the backspace key, you can grab
    key presses from user input. I'm not 100% on this but you could use
    Flash to test the key being pressed. If backspace is pressed, find
    out the current object with focus (unsure of this part), if it's an
    input box in flash, have flash handle it or if a text box doesn't
    have focus, send it out to javascript to have it handle it.

  • Disable backspace key as 'go back'

    Does anyone know a way to prevent the backspace key from acting like a shortcut for "Go back"?
    I never, ever use backspace for that function. The only times I go to the previous webpage by pressing the backspace key are unintentional and often cause loss of information on dynamic webpages.
    I believe that making the backspace key act as both a text editing tool and a history navigation shortcut, based solely on whether the cursor is inside a text field or not, is a serious design flaw. I may be mistaken but I believe this behaviour was copied from Internet Explorer. Why on earth did Apple copy a design flaw from the most flawed browser in the world?
    So, kudos to anyone who knows a Safari equivalent of setting "browser.backspace_action 2" in Firefox.

    Hi Derek,
    This feature is sufficiently annoying to make we want to change browsers until Apple fixes it.
    Safari menu > Report Bugs to Apple...
    Everyone here on the forum is just a fellow user like yourself. I'm not aware of a way to override it, but maybe someone else will chime in.

  • Disable backspace action in Safari

    I have an EXTREMELY annoying problem with Safari 4.0.5, seems that sometimes when I am typing into a textbox, I'll somehow randomly lose focus of the text box (especially with the magic mouse), and as a result the delete button will cause the browser to go back a page. Extremely annoying because when I go forward again all my content I was typing has been lost.
    How can I kill this browser behavior, why is there not an option to disable it in Safari?

    HI,
    It sounds like your mouse settings might be too sensitive. Go to System Preferences/Mouse.
    Carolyn

  • ComboBoxRenderer does not look like Windows 7 ComboBox

    Hi,
    When I call Application.EnableVisualStyles in WinForms application on Windows 7, a ComboBox looks "modern" - it is a white background with a black arrow.  When I do not call EnableVisualStyles, the ComboBox is "legacy" - a gray background.
    However, ComboBoxRenderer.DrawDropDownButton always looks "legacy" - it always draws it with a gray background.  I also tried ControlPaint methods but it also looked "legacy."
    How do I draw custom combo box button that is "modern" in C# (or even p/Invoke to GDI or GDI+)?
    Thanks.

    There are 3 DropDownStyles for combobox and each one renders differently.
    Below are 3 simple methods to draw a combobox dependant on style and state:
    private void DrawSimpleCombo(Graphics graphics, Rectangle bounds, ComboBoxState state)
    VisualStyleRenderer renderer;
    if (state != ComboBoxState.Disabled)
    renderer = new VisualStyleRenderer("COMBOBOX", 4, 2);
    renderer.DrawBackground(graphics, bounds);
    else
    renderer = new VisualStyleRenderer("EDIT", 1, 1);
    renderer.DrawBackground(graphics, bounds);
    Rectangle rc = renderer.GetBackgroundContentRectangle(graphics, bounds);
    rc.Inflate(-2, -2);
    graphics.FillRectangle(SystemBrushes.Control, rc);
    private void DrawDropDownCombo(Graphics graphics, Rectangle bounds, ComboBoxState state, bool focused)
    VisualStyleRenderer renderer = new VisualStyleRenderer("COMBOBOX", 4, state > ComboBoxState.Normal || focused ? 2 : 1);
    VisualStyleRenderer buttonRenderer = new VisualStyleRenderer("COMBOBOX", 7, (int)state);
    Size szP = buttonRenderer.GetPartSize(graphics, ThemeSizeType.True);
    buttonRenderer.SetParameters("COMBOBOX", 7, (int)state);
    Size szR = buttonRenderer.GetPartSize(graphics, ThemeSizeType.True);
    buttonRenderer.SetParameters("COMBOBOX", 6, (int)state);
    Size szL = buttonRenderer.GetPartSize(graphics, ThemeSizeType.True);
    Size sz = new Size(szL.Width + szR.Width + szP.Width, szP.Height);
    if (state != ComboBoxState.Disabled)
    renderer.DrawBackground(graphics, bounds);
    else
    renderer = new VisualStyleRenderer("EDIT", 1, 1);
    renderer.DrawBackground(graphics, bounds);
    Rectangle client = renderer.GetBackgroundContentRectangle(graphics, bounds);
    client.Inflate(-2, -2);
    client.Width -= sz.Width;
    graphics.FillRectangle(SystemBrushes.Control, client);
    Rectangle rc = Rectangle.FromLTRB(bounds.Right - (sz.Width), bounds.Top, bounds.Right, bounds.Bottom);
    buttonRenderer.DrawBackground(graphics, rc);
    private void DrawDropDownListCombo(Graphics graphics, Rectangle bounds, ComboBoxState state)
    VisualStyleRenderer renderer = new VisualStyleRenderer("COMBOBOX", 5, (int)state);
    renderer.DrawBackground(graphics, bounds);
    renderer.SetParameters("COMBOBOX", 1, 1);
    Size szP = renderer.GetPartSize(graphics, ThemeSizeType.True);
    renderer.SetParameters("COMBOBOX", 7, 1);
    Size szR = renderer.GetPartSize(graphics, ThemeSizeType.True);
    renderer.SetParameters("COMBOBOX", 6, state == ComboBoxState.Disabled ? 4 : 1);
    Size szL = renderer.GetPartSize(graphics, ThemeSizeType.True);
    Size sz = new Size(szL.Width + szR.Width + szP.Width, szP.Height);
    Rectangle rc = Rectangle.FromLTRB(bounds.Right - (sz.Width), bounds.Top, bounds.Right, bounds.Bottom);
    renderer.DrawBackground(graphics, rc);
    public enum ComboBoxState
    Normal = 1, Hot, Pressed, Disabled
    Mick Doherty
    http://dotnetrix.co.uk
    http://glassui.codeplex.com

  • Why iPhone display border is black then light green then pink. Please  reply me i saw this in many iPhones.

    why iPhone display border is black then light green then pink. Please  reply me i saw this in many iPhones.

    Hello, Greg et al:
    I figured out the problem and got the project working (sort of): the app did not like 'resetKeywordList()' in 'localeList_changeHandler', so I set the keywordList in the two 'getKWs_[locale]ResultHandlers' directly (result of the calls to my CFC).
    That fixed the issue, but not completely: if I change language while the KeywordSelect ComboBox (on the right) selected item is not 'ALL' the cartoon AC does not refresh correctly. For now, I am getting around this by disabling the language change ComboBox (on the left) when anything other than ALL is selected. This is not so bad, until I figure out what the problem is.
    If anyone wants to look, you can access the Main page of the app from here, http://www.timos.com/timos/green/greenPlanet.cfm, by pressing the CounterThink logo at the bottom. The new page, not linked to from my site yet, is   http://www.timos.com/timos/green/ct/CounterThinkNEW.cfm (just insert NEW before the .cfm extension).
    I know my code could be a lot better and intend to keep working on it, so I would love and really appreciate comments/suggestions that anyone wants to provide.
    Regards and ciao for now.
    Carlos

  • Able to drag drop items of combobox but want to disable 1st item

    Hello Sir,
    I am able to drag drop elements of the combobox.
    Here is my code...
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:local="*" xmlns:utils="adobe.utils.*" xmlns:controls="qs.controls.*" initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    [Bindable]
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML = <test>
    <col>
    <col1>one</col1>
    </col>
    <col>
    <col1>two</col1>
    </col>
    <col>
    <col1>three</col1>
    </col>
    <col>
    <col1>four</col1>
    </col>
    <col>
    <col1>five</col1>
    </col>
    <col>
    <col1>six</col1>
    </col>
    <col>
    <col1>seven</col1>
    </col>
      </test>;
      cb1.dataProvider = xml;
      comboLength = xml.col.length();
      cb1.rowCount = comboLength;
      str = (xml.col[0].col1.toString());
      cb1.prompt = str;
    public function closeHandler(event:Event):void
    if(MouseEvent.DOUBLE_CLICK)
    // Alert.show("Click Event");
    public function changeHandler(event:ListEvent):void
    // Alert.show("Single Click Event");
    public function doubleClickEvent(event:MouseEvent):void
    Alert.show(event.currentTarget.toString());
    Alert.show(event.target.toString(),"Double Click");
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent.toString());
    ]]>
    </mx:Script>
    <mx:ComboBox id="cb1" prompt="prashant" doubleClickEnabled="true" doubleClick="doubleClickEvent(event)"
    close="closeHandler(event)" dragEnter="dragEnterFunction(event)" >
    <mx:itemRenderer>
    <mx:Component>
    <mx:DataGrid itemClick="outerDocument.cb1.text = this.selectedItem.col1.toString();itemSelected(event)"
    dragEnabled="true" dropEnabled="true" dragDrop="draDropHandler(event)" dragMoveEnabled="true" headerHeight="0" showHeaders="false"
    creationComplete="init()" click="clickable()"
    itemDoubleClick="doubleClickEvent(event)">
    <mx:columns>
    <mx:DataGridColumn dataField="col1" headerText="" id="da" disabledColor="white"  />
    </mx:columns>
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid;
    import mx.events.DropdownEvent;
    import mx.events.ListEvent;
    import mx.events.DragEvent;
    import mx.controls.Label;
    import mx.controls.Alert;
    public function clickable():void
    //Alert.show("clickable");
    public function itemSelected(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Single Click");
         public function draDropHandler(event:Event):void
    Alert.show(event.target.parent.toString());
    public function dragEnterFunction(event:DragEvent):void
    Alert.show(event.target.parent);
    override public function set data( value:Object ) : void
    this.dataProvider = value.col;
    //outerDocument.cb1.text = this.selectedItem.col1.toString()
    //myList.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, onItemDoubleClick,
    public function doubleClickEvent(event:ListEvent):void
    Alert.show(event.itemRenderer.data.col1,"Double Click");
    ]]>
    </mx:Script>
    </mx:DataGrid>
    </mx:Component>
    </mx:itemRenderer>
    </mx:ComboBox>
    </mx:Application>
    But now i want to disable drag drop of the 1st item and the last item.
    And also add double click of each item.
    Can someone please help me out.
    Awaiting your reply.
    Thanks in advance.

    Hello Sir,
    Thanks a lot for your reply.
    I have implemented some thing can you please help me out with this?
    In this can you help me out with the double click event????
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    xmlns:local="" xmlns:utils="adobe.utils." xmlns:controls="qs.controls.*"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.DragEvent;
    import mx.events.ListEvent;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.ComboBox;
    import mx.controls.Alert;
    import mx.controls.listClasses.ListBase;
    import mx.core.UIComponent;
    public var str:String = "";
    public var comboLength:int;
    public function init():void
    var xml:XML =
    </mx:Application

  • Backspace key disable

    this is sort of a javascript question, but its on my jsp pages so i'll ask. ;)
    I would like to be able to disable the backspace key so that
    a user cannot hit it to travel back a page. However, i want to leave
    it enabled so that they can at least backspace while in form text elements and text areas, etc.
    i have this bit of code (see bottom) that will capture the backspace, but it turns it off even for the text elements in a form.
    the good news is that its for an intranet application and we are only going to be supporting IE 5.5 or better, so it doesn't have to be cross browser compatible
    thanks,
    ken
    <script language="JavaScript"><!--
    document.onkeydown = mykeyhandler;
    function mykeyhandler() {
        if (window.event && window.event.keyCode == 8) {
            // try to cancel the backspace
            window.event.cancelBubble = true;
            window.event.returnValue = false;
            return false;
    //--></script>

    There are two ways to approach this, and neither are very elegant, though they both should work in i.e. (other browsers will presumably have an analogous method for accomplishing them). Firstly, you could use a client script to populate the onblur and onfocus properties of all your forms on the client page. Something like
    for(var i = 0; i < document.forms.lenth; i++) {
        document.forms.item(i).onfocus =  "inform=true";
        document.forms.item(i).onblur = "inform=false";
    }This means that you could leave your forms the way they are. Note that the forms collection of the document is an i.e. only thing. Alternatively, and this is the preferred method, you could simply ask the even which object fired it and evaluate whether or not to cancel the event using an if statement. Again, in i.e. only, every event has the srcElement property which is the object that fired the even. In the case of a keydown event, the object that fires the event is whatever is selected when you press the key. Specifically, if the backspace key is pressed in a text field or textbox etc. it will tell you if you ask. Something like
    document.onkeydown = keyCatcher
    function keyCatcher() {
        var e = event.type;
        if(event.keyCode==8 &&  e != "text" && e !="password" && e !="textarea" ) {
            event.cancelBubble = true;
            event.returnValue = false;
    }You'll notice that the previous method is by far the fastest as it only has 3 compisons, as opposed to the many required for sorting through all of the form and input elements. Also you need no global variables.
    Lastly you could check to see if an input tag is the activeElement when the backspace key is pressed and if one is, block it. Something like
    document.onkeydown = keyCatcher
    function keyCatcher() {
        if(event.keyCode==8 ) {
            for(var i = 0; i < document.tags("input").lenth; i++) {
                if(document.tags("input").item(i) == document.activeElement) {
                    event.cancelBubble = true;
                    event.returnValue = false;
    }Again, both the tags collection and the activeElement property are I.E. only things. For other browsers I assume you would need some kind of detection script and some options (or just don't block they're backspace keys). Also, I haven't tested any of this code, but you get the idea.

  • Disabling auto-complete on Spark ComboBox

    I want to disable the auto-completing of text entered into a ComboBox, but still have it match the text against items in the DropDownList. Is there any easy way to do this?

    Simply create you new combobox class and override the findStringLoop function, it should always return -1 to prohibit the fincding of matching items (for autocomplete reasons).
    Code is the following:
                         * Disabel the autocomplete option on Spark Combobox
                        mx_internal override function findStringLoop(str:String, startIndex:int, stopIndex:int):Number
                             return -1;

  • How to disable a combobox

    i want to disable a comboBox as soon as a form loads... i used this piece of code but it didin't work:
    comboBoxName.setEditable(false);
    pls. give me other code that would solve my simple problem... thanks!!!

    comboBoxName.setEnabled(false);

  • ComboBox disabled after binding with vo

    Hi,
    i have comboBox... its is enabled..after binding with view object its disabled.. Ive tried to change it from code and property inspector but nothing helps.\
    Code from pageDef
    <combobox id="DCComboBox" xmlns="http://xmlns.oracle.com/adfm/jcuimodel"
    ListOperMode="navigation" IterBinding="SerieROView1Iter" StaticList="true" ApplyValidation="false" Editable="false">
    <AttrNames xmlns="http://xmlns.oracle.com/adfm/uimodel">
    <Item Value="NazwaSkrocona"/>
    </AttrNames>
    </combobox>

    ive added Viewable="true" in section above and it is working - combo is enabled and i can view attributes.... but i get errors in jdeveloper log
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
         at oracle.adf.model.binding.DCControlBinding.evaluateBooleanExpression(DCControlBinding.java:523)
         at oracle.adf.model.binding.DCControlBinding.isControlViewable(DCControlBinding.java:515)
         at oracle.jbo.uicli.binding.JUCtrlValueBinding.isViewable(JUCtrlValueBinding.java:3207)
         at oracle.jbo.uicli.binding.JUCtrlAttrsBinding$mySetEnabledThread.run(JUCtrlAttrsBinding.java:45)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    i understand it is connected with Viewable="true", but while editing xml it is expecting String.
    And yes - it is read only VO - so why its working now? :)

  • Disabling comboboxes after a certain limit has been met

    I have 4 comboboxes called:
    cboOption1 
    cboOption2 
    cboOption3 
    cboOption4
    Each of them can have one of 2 values, either 10 or 20 points, which the user selects from a drop down. However, the user can only select a maximum of 40 points across all drop downs, after which the remaining dropdowns that follow will be disabled.
    E.g. 1
    cboOption1 = 20
    cboOption2 = 20
    Then
    cboOption3.Enabled = False
    cboOption3.Enabled = False 
    E.g. 2
    cboOption1 = 10
    cboOption2 = 20
    cboOption3 = 10
    Then
    cboOption4.Enabled = False 
    E.g. 3
    cboOption1 = 10
    cboOption2 = 10
    cboOption3 = 10
    cboOption3 = 40
    Then
    None disabled.
    My problem
    The difficulty I'm experiencing at the moment is figuring out how to flick the comboboxes on/off in response to user input. This is my code so far, it doesn't seem to be working too well, any idea how I can improve it.
    Code so far
    Sub checkTotal(var1, var2, var3, var4, total)
    so1 = Int(var1)
    so2 = Int(var2)
    so3 = Int(var3)
    so4 = Int(var4)
    total = Nz(so1, 0) + Nz(so2, 0) + Nz(so3, 0) + Nz(so4, 0)
    If total > 40 And (so1 = "20" Or so2 = "20" Or so3 = "20" Or so4 = "20") Then
    cboOption3.Value = ""
    cboOption3.Enabled = False
    cboOption4.Value = ""
    cboOption4.Enabled = False
    End If
    MsgBox total
    End Sub
    Private Sub cboOption1_Change()
    Call checkTotal(cboOption1.Column(1), cboOption2.Column(1), cboOption3.Column(1), cboOption4.Column(1), so1RunningTotal)
    End Sub
    Private Sub cboOption2_Change()
    Call checkTotal(cboOption1.Column(1), cboOption2.Column(1), cboOption3.Column(1), cboOption4.Column(1), so1RunningTotal)
    End Sub
    Private Sub cboOption3_Change()
    Call checkTotal(cboOption1.Column(1), cboOption2.Column(1), cboOption3.Column(1), cboOption4.Column(1), so1RunningTotal)
    End Sub
    Private Sub cboOption4_Change()
    Call checkTotal(cboOption1.Column(1), cboOption2.Column(1), cboOption3.Column(1), cboOption4.Column(1), so1RunningTotal)
    End Sub

    Hi Methuselah,
    You are using VB6, it is antique, that while it needs a license to use and to deploy programs from.
    There is currently at Microsoft a complete community 2013 version of the latest version of VB (VB12 also named VB2013), why not try that one.
    You can use it free and deploy the programs you've made with it.
    http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
    It is bellow the 90 day versions and then the community one.
    Success
    Cor

Maybe you are looking for

  • Accounting doc is not create?

    Hello cham's, After creating the billing document it was not posted into finance and the system is showing accounting document is not created.  How to procede to resolve this error will anyone share your expertise?.

  • Dump in f4 help

    I have developed one program to download spool job for that i have taking sppol number and file name in selection screen . In the seelction screen for file name i have kept f4 for filename it is working fine but if i did not give the extension it is

  • DocumentBuilderFactory question

    Hi to all! Is it possible to force DocumentBuilderFactory to use default platform implementation? It's neither possible to change system property in applet nor write a file in lib directory. Thanks

  • Obtain Data Table header Dynamicaly

    Hi all, I have a requirment. user will give the name of a database table and all the field-header (i.e. Field labels) will be stored in a internal table. Is there any FM , suitable for that. Thanks in advance. Regards, Anirban

  • What is the JDEV RAD way to do JSP ?

    Hello, As I see it there are some basics to doing web/jsp app's... How does jdeveloper save you typing in doing the following tasks? What jdeveloper tools/functions to I use to accomplish the following with minimal typing? 1) create/manager the sessi