Click here to Skip to main content
15,881,424 members
Articles / Programming Languages / XML

Flexible ComboBox and EditingControl

Rate me:
Please Sign up or sign in to vote.
4.80/5 (10 votes)
30 Apr 2012CPOL6 min read 53.7K   5.7K   37  
Using any Control In ComboBox or in EditingControl for DataGridView
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.1
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------




using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;

namespace DropDownDemo {
    namespace Properties {

        [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute(), global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal sealed partial class Settings : System.Configuration.ApplicationSettingsBase {

            private static Settings defaultInstance = (Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()));

    #region My.Settings Auto-Save Functionality
//INSTANT C# TODO TASK: C# compiler constants cannot be set to explicit values:
//    #if _MyType == "WindowsForms"
            private static bool addedHandler;

            private static object addedHandlerLockObject = new object();

            [global::System.Diagnostics.DebuggerNonUserCodeAttribute(), global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
            private static void AutoSaveSettings(object sender, global::System.EventArgs e) {
                if (My.MyApplication.Application.SaveMySettingsOnExit)
                    defaultInstance.Save();
            }
//#endif
    #endregion

            public static Settings Default {
                get {

//INSTANT C# TODO TASK: C# compiler constants cannot be set to explicit values:
//    #if _MyType == "WindowsForms"
                       if (! addedHandler) {
                            lock (addedHandlerLockObject) {
                                if (! addedHandler) {
                                    My.MyApplication.Application.Shutdown += AutoSaveSettings;
                                    addedHandler = true;
                                }
                            }
                        }
//#endif
                    return defaultInstance;
                }
            }
        }
    }

//Namespace My
//
//    <Microsoft.VisualBasic.HideModuleNameAttribute(), global::System.Diagnostics.DebuggerNonUserCodeAttribute(), global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()> Friend Module MySettingsProperty
//
//        <global::System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> Friend ReadOnly Property Settings() As DropDownDemo.My.MySettings
//            Get
//                return DropDownDemo.My.MySettings.Default
//            End Get
//        End Property
//    End Module
//End Namespace

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Lebanon Lebanon
ASP.Net Hosting on Linux server
---------------------------
There is a developer behind every piece of code!
DNA is too complex what about it!
No junk DNA; There is a functional role for noncoding DNA

Comments and Discussions