Inheritance: ListControl
Example #1
1
 public Continent(ListBox displayBox, Random rGen, int nAnimalTypes, Graphics canvas)
 {
     this.displayBox = displayBox;
     this.rGen = rGen;
     this.nAnimalTypes = nAnimalTypes;
     this.canvas = canvas;
 }
        public static void addRemoveFields(ListBox listBoxToRemove, ListBox listBoxToAdd)
        {
            if (listBoxToRemove == null || listBoxToAdd == null)
            return;

             if (listBoxToRemove.SelectedItems.Count < 1)
             {
            return;
             }
             else
             {
            List<string> selTexts = new List<string>();
            listBoxToAdd.ClearSelected();
            foreach (object obj in listBoxToRemove.SelectedItems)
            {
               int nIndex = listBoxToAdd.Items.Add(obj);
               listBoxToAdd.SetSelected(nIndex, true);
               selTexts.Add(obj.ToString());
            }

            foreach (string selText in selTexts)
            {
               listBoxToRemove.Items.Remove(selText);
            }

            listBoxToRemove.ClearSelected();
             }
        }
Example #3
1
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            if (context != null && provider != null)
            {
                edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (edSvc != null)
                {
                    lb = new ListBox();
                    lb.Items.AddRange(new object[] {
                        "Sunday",
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday"});
                    lb.SelectedIndexChanged += new System.EventHandler(lb_SelectedIndexChanged);
                    edSvc.DropDownControl(lb);
                }
                return text;

            }

            return base.EditValue(context, provider, value);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public AutoCompleteTextbox()
            : base()
        {
            entireList = new List<string>();
            matchingList = new List<string>();

            lboxSuggestions = new ListBox();
            lboxSuggestions.Name = "SuggestionListBox";
            lboxSuggestions.Font = this.Font;
            lboxSuggestions.Visible = true;
            lboxSuggestions.Dock = DockStyle.Fill;// make the listbox fill the panel
            lboxSuggestions.SelectionMode = SelectionMode.One;
            lboxSuggestions.KeyDown += new KeyEventHandler(listBox_KeyDown);
            lboxSuggestions.MouseClick += new MouseEventHandler(listBox_MouseClick);
            lboxSuggestions.DataSource = matchingList;// Bind matchingList as DataSource to the listbox

            this.GotFocus += new EventHandler(AutoCompleteTextbox_GotFocus);

            //Will hold listbox
            panel = new Panel();
            panel.Visible = false;
            panel.Font = this.Font;
            panel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            panel.ClientSize = new System.Drawing.Size(1, 1);
            panel.Name = "SuggestionPanel";
            panel.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
            panel.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
            panel.Text = "";
            panel.PerformLayout();
            if (!panel.Controls.Contains(lboxSuggestions)) { this.panel.Controls.Add(lboxSuggestions); }
        }
        public ListBox AddNewListBox()
        {
            ListBox  newListBox = new
                ListBox();

            //add to the collection list
            this.List.Add(newListBox);

            //add to the overall form controls
            Hatchu.Controls.Add(newListBox);

            newListBox.Top = 69 + levelCount * 170;
            newListBox.Width = 95;
            newListBox.Left = miniCount * (newListBox.Width + 10) + 80;
            newListBox.Tag = this.Count;
            newListBox.Text = "";

            miniCount++;

            if (Count % 6 == 0)
            {
                miniCount = 0;
                levelCount++;
            }

            newListBox.KeyDown += new System.Windows.Forms.KeyEventHandler(KeyDownHandler);

            return newListBox;
        }
Example #6
1
        public int getAllAttrs(ListBox.ObjectCollection list)
        {
            list.Clear();

            if (fcat != null) {
                var attrs = fcat.GetAttributes();
                if (attrs != null) {
                    int i=0;
                    foreach(var attr in attrs) {

                        string s=attr.Alias;
                        if (convert.IsString(s)) {
                            s+="<"+attr.ValueType+">";

                            string t=attr.ToString();
                            if (convert.IsString(t)) s+=" // "+t;

                            i++;
                            list.Add(String.Format("{0}. {1}",i,s));
                        }
                    }
                }
            }

            return list.Count;
        }
Example #7
1
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.button1 = new System.Windows.Forms.Button();
			this.listBox1 = new System.Windows.Forms.ListBox();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(32, 32);
			this.button1.Name = "button1";
			this.button1.Size = new System.Drawing.Size(208, 23);
			this.button1.TabIndex = 0;
			this.button1.Text = "Call \"HelloWorld\" on remote object";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// listBox1
			// 
			this.listBox1.Location = new System.Drawing.Point(32, 72);
			this.listBox1.Name = "listBox1";
			this.listBox1.Size = new System.Drawing.Size(224, 95);
			this.listBox1.TabIndex = 1;
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(292, 266);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.listBox1,
																		  this.button1});
			this.Name = "Form1";
			this.Text = "RemoteObject";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}
Example #8
1
        private void InitTabControlPages()
        {
            foreach(var obj in CardLevels)
            {
                var page = new TabPage { Text = CardLevel.RoleCardLevelName(obj) };
                CardTabControl.TabPages.Add(page);

                var listData        = new BindingList<RoleCard>();
                var list            = new ListBox()
                {
                    Dock                = DockStyle.Fill,
                    ContextMenuStrip    = TabControlContextMenu,
                    DisplayMember       = "Name",
                    ValueMember         = "Id",
                    DataSource          = listData,
                };
                
                list.SelectedIndexChanged += (sender, msg) =>
                {
                    var item = list.SelectedItem as RoleCard;
                    if (ListOfRoleCardList[CardTabControl.SelectedIndex].Contains(item))
                    {
                        SelectedItem = item;

                        cardInfoControl1.BeginModify();
                        cardInfoControl1.Images     = CardImageDictionary[SelectedItem.Id];
                        cardInfoControl1.RoleCard   = SelectedItem;
                        cardInfoControl1.EndModify();
                    }
                };

                page.Controls.Add(list);
                ListOfRoleCardList.Add(listData);
            }
        }
 public PreferenceListDetails(PreferenceList preferenceList, ListBox listBox, Button buttonUp, Button buttonDown)
 {
   _preferenceList = preferenceList;
   _list = listBox;
   _up = buttonUp;
   _down = buttonDown;
 }
Example #10
1
 public void add_list_content(ListBox listbox, ArrayList strings)
 {
     foreach (String name in strings)
     {
         listbox.Items.Add(name);
     }
 }
Example #11
1
        public static void SaveCurrentEnvironment(LoadedSettings loadedSettings, ListBox environmentsListBox, EnvironmentStruct environment)
        {
            var currentEnvironment = loadedSettings.Environments.First(env => env.ID == environment.ID);

            if (environment.ID == Guid.Empty) return;

            if (currentEnvironment.Name != environment.Name)
                currentEnvironment.Name = environment.Name;
            if (currentEnvironment.SubkeyValue != environment.SubkeyValue)
                currentEnvironment.SubkeyValue = environment.SubkeyValue;
            if (currentEnvironment.HotKey != environment.HotKey)
                currentEnvironment.HotKey = environment.HotKey;
            if (currentEnvironment.IconLabel != environment.IconLabel)
                currentEnvironment.IconLabel = environment.IconLabel;
            if (currentEnvironment.IconTextColor != environment.IconTextColor)
                currentEnvironment.IconTextColor = environment.IconTextColor;
            if (currentEnvironment.IconBackgroundColor != environment.IconBackgroundColor)
                currentEnvironment.IconBackgroundColor = environment.IconBackgroundColor;
            if (currentEnvironment.LoadIcon != environment.LoadIcon)
                currentEnvironment.LoadIcon = environment.LoadIcon;
            if (currentEnvironment.IconFileLocation != environment.IconFileLocation)
                currentEnvironment.IconFileLocation = environment.IconFileLocation;
            if (currentEnvironment.DisplayOnMenu != environment.DisplayOnMenu)
                currentEnvironment.DisplayOnMenu = environment.DisplayOnMenu;

            ListboxUtils.RepopulateListBox(true, environmentsListBox, loadedSettings, environment.ID);
            ListboxUtils.SetCurrentOrderFromListBoxAndSave(true, environmentsListBox, loadedSettings);

            MessageBox.Show($"{currentEnvironment.Name} {Constants.Messages.SavedSuccessfully}",
                            $"Environment {Constants.Messages.SavedSuccessfullyCaption}",
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Example #12
1
        public void ShowResponse(IRequest request, Uri response)
        {
            _guiContext.Post(_ =>
                                 {
                                     foreach (TabPage source in responsesTab.TabPages)
                                     {
                                         if (source.Text.Equals(request.SearchCriteria.Value))
                                         {
                                             ListBox list;
                                             if (source.Controls.Count == 0)
                                             {
                                                 list = new ListBox {Dock = DockStyle.Fill};
                                                 source.Controls.Add(list);
                                             }
                                             else
                                                list = source.Controls[0] as ListBox;

                                             if (list != null)
                                             {
                                                 list.Items.Add(response);
                                             }
                                             break;
                                         }
                                     }
                                 }, null);
        }
Example #13
1
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.lbNodes = new System.Windows.Forms.ListBox();
			this.btnLoadXml = new System.Windows.Forms.Button();
			this.SuspendLayout();
			// 
			// lbNodes
			// 
			this.lbNodes.Location = new System.Drawing.Point(8, 40);
			this.lbNodes.Name = "lbNodes";
			this.lbNodes.Size = new System.Drawing.Size(432, 303);
			this.lbNodes.TabIndex = 3;
			// 
			// btnLoadXml
			// 
			this.btnLoadXml.Location = new System.Drawing.Point(8, 8);
			this.btnLoadXml.Name = "btnLoadXml";
			this.btnLoadXml.Size = new System.Drawing.Size(112, 23);
			this.btnLoadXml.TabIndex = 2;
			this.btnLoadXml.Text = "Load XML";
			this.btnLoadXml.Click += new System.EventHandler(this.btnLoadXml_Click);
			// 
			// StepByStep6_28
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(448, 357);
			this.Controls.AddRange(new System.Windows.Forms.Control[] {
																		  this.lbNodes,
																		  this.btnLoadXml});
			this.Name = "StepByStep6_28";
			this.Text = "StepByStep6_28";
			this.ResumeLayout(false);

		}
Example #14
1
        //deals the deck to the players
        public void dealAndDisplay(ListBox player1,ListBox player2,ListBox player3,ListBox player4)
        {
            hands = new Hand[numPlayers];
            //initialises hand array get null exception error without it
            for (int i = 0; i < numPlayers; i++)
            {
                hands[i] = new Hand();
            }

            int count=0;

            for (int i = 0; i < handSize; i++)
            {
                for (int j = 0; j < numPlayers; j++)
                {
                    hands[j].Cards[i] = deck[count];
                    count++;
                }
            }

            hands[0].displayHand(player1);
            hands[1].displayHand(player2);
            hands[2].displayHand(player3);
            hands[3].displayHand(player4);
        }
 public static void AddDeleteAction(Shape shape, ref ListBox listBoxShapes, ref GroupBox groupBoxShape)
 {
     if (IsActionTrackingDisabled)
         return;
     UpdateUndoRedoValues();
     actions.Add(new UndoRedo.WorkingActionDelete(shape, Editor.Shapes, ref listBoxShapes, ref groupBoxShape));
 }
Example #16
1
		protected override void SetUp ()
		{
			listBox = new ListBox();
			form = new Form();
			form.ShowInTaskbar = false;
			base.SetUp ();
		}
Example #17
1
        public ListBoxLog(ListBox listBox, string messageFormat, int maxLinesInListbox, bool debug = true)
        {
            _debug = debug;
            _disposed = false;

            _listBox = listBox;
            _messageFormat = messageFormat;
            _maxEntriesInListBox = maxLinesInListbox;

            _paused = false;

            _canAdd = listBox.IsHandleCreated;

            _listBox.SelectionMode = SelectionMode.MultiExtended;

            _listBox.HandleCreated += OnHandleCreated;
            _listBox.HandleDestroyed += OnHandleDestroyed;
            _listBox.DrawItem += DrawItemHandler;
            _listBox.KeyDown += KeyDownHandler;

            MenuItem[] menuItems = new MenuItem[] { new MenuItem("Copy", new EventHandler(CopyMenuOnClickHandler)) };
            _listBox.ContextMenu = new ContextMenu(menuItems);
            _listBox.ContextMenu.Popup += new EventHandler(CopyMenuPopupHandler);

            _listBox.DrawMode = DrawMode.OwnerDrawFixed;
        }
Example #18
1
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm));
     this.label1 = new System.Windows.Forms.Label();
     this.listBox1 = new System.Windows.Forms.ListBox();
     this.groupBox1 = new System.Windows.Forms.GroupBox();
     this.groupBox1.SuspendLayout();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location = new System.Drawing.Point(64, 16);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(248, 32);
     this.label1.TabIndex = 1;
     this.label1.Text = "HyperLoad 2.0";
     //
     // listBox1
     //
     this.listBox1.Items.AddRange(new object[] {
     "This program is completely free to use!",
     "",
     "Hyperload is an open-source program that can be used to",
     "program *.HEX files to your microcontroller.",
     "",
     "The Hyperload Protocol & related information can be found at:",
     "www.sociaLLedge.com/sjsu"});
     this.listBox1.Location = new System.Drawing.Point(14, 84);
     this.listBox1.Name = "listBox1";
     this.listBox1.Size = new System.Drawing.Size(304, 108);
     this.listBox1.TabIndex = 5;
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Controls.Add(this.listBox1);
     this.groupBox1.Location = new System.Drawing.Point(8, 8);
     this.groupBox1.Name = "groupBox1";
     this.groupBox1.Size = new System.Drawing.Size(320, 210);
     this.groupBox1.TabIndex = 8;
     this.groupBox1.TabStop = false;
     //
     // AboutForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BackColor = System.Drawing.SystemColors.Control;
     this.ClientSize = new System.Drawing.Size(338, 225);
     this.Controls.Add(this.groupBox1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "AboutForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "About";
     this.Deactivate += new System.EventHandler(this.AboutForm_Deactivate);
     this.groupBox1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
        /// <summary>
        /// Displays a list of available values for the specified component than sets the value.
        /// </summary>
        /// <param name="context">An ITypeDescriptorContext that can be used to gain additional context information.</param>
        /// <param name="provider">A service provider object through which editing services may be obtained.</param>
        /// <param name="value">An instance of the value being edited.</param>
        /// <returns>The new value of the object. If the value of the object hasn't changed, this method should return the same object it was passed.</returns>
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                // This service is in charge of popping our ListBox.
                _service = ((IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)));

                if (_service != null && value is DropDownListProperty)
                {
                    var property = (DropDownListProperty) value;

                    var list = new ListBox();
                    list.Click += ListBox_Click;

                    foreach (string item in property.Values)
                    {
                        list.Items.Add(item);
                    }

                    // Drop the list control.
                    _service.DropDownControl(list);

                    if (list.SelectedItem != null && list.SelectedIndices.Count == 1)
                    {
                        property.SelectedItem = list.SelectedItem.ToString();
                        value =  property;
                    }
                }
            }

            return value;
        }
Example #20
1
 private static void RefreshListBox(ListBox log, string[] items)
 {
     var selectLastIndex = log.Items.Count == 0 || log.SelectedIndex == log.Items.Count - 1;
     log.DataSource = items;
     if (selectLastIndex && log.Items.Count > 0)
         log.SelectedIndex = log.Items.Count - 1;
 }
 public DatabaseScanner(ListMaker lm)
     : this()
 {
     listMaker = lm;
     if (lm != null)
         AWBListbox = lm.Items;
 }
Example #22
0
 public Continent(ListBox displayBox, Graphics canvas, int nAnimalTypes)
 {
     this.displayBox = displayBox;
     this.canvas = canvas;
     this.nAminalTypes = nAnimalTypes;
     randomGen = new Random();
 }
Example #23
0
 private void InitializeComponent()
 {
     this.picture = new System.Windows.Forms.PictureBox();
     this.splitContainer1 = new System.Windows.Forms.SplitContainer();
     this.list = new System.Windows.Forms.ListBox();
     ((System.ComponentModel.ISupportInitialize)(this.picture)).BeginInit();
     this.splitContainer1.Panel1.SuspendLayout();
     this.splitContainer1.Panel2.SuspendLayout();
     this.splitContainer1.SuspendLayout();
     this.SuspendLayout();
     //
     // picture
     //
     this.picture.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
     this.picture.Dock = System.Windows.Forms.DockStyle.Fill;
     this.picture.Location = new System.Drawing.Point(0, 0);
     this.picture.Name = "picture";
     this.picture.Size = new System.Drawing.Size(811, 689);
     this.picture.TabIndex = 0;
     this.picture.TabStop = false;
     //
     // splitContainer1
     //
     this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.splitContainer1.Location = new System.Drawing.Point(0, 0);
     this.splitContainer1.Name = "splitContainer1";
     //
     // splitContainer1.Panel1
     //
     this.splitContainer1.Panel1.Controls.Add(this.list);
     //
     // splitContainer1.Panel2
     //
     this.splitContainer1.Panel2.Controls.Add(this.picture);
     this.splitContainer1.Size = new System.Drawing.Size(969, 693);
     this.splitContainer1.SplitterDistance = 150;
     this.splitContainer1.TabIndex = 2;
     //
     // list
     //
     this.list.Dock = System.Windows.Forms.DockStyle.Fill;
     this.list.FormattingEnabled = true;
     this.list.Location = new System.Drawing.Point(0, 0);
     this.list.Name = "list";
     this.list.Size = new System.Drawing.Size(146, 680);
     this.list.TabIndex = 0;
     this.list.SelectedIndexChanged += new System.EventHandler(this.list_SelectedIndexChanged);
     //
     // GdiForm
     //
     this.ClientSize = new System.Drawing.Size(969, 693);
     this.Controls.Add(this.splitContainer1);
     this.Name = "GdiForm";
     ((System.ComponentModel.ISupportInitialize)(this.picture)).EndInit();
     this.splitContainer1.Panel1.ResumeLayout(false);
     this.splitContainer1.Panel2.ResumeLayout(false);
     this.splitContainer1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Example #24
0
 public TEditor(ListBox lb, Song song, GUI owner, Translation trans)
 {
     //
     // Erforderlich f├╝r die Windows Form-Designerunterst├╝tzung
     //
     InitializeComponent();
     this.song = song;
     this.trans = trans;
     this.lb = lb;
     this.owner = owner;
     this.textBox2.Text = this.song.Number.ToString();
     this.textBox2.Enabled = false;
     TEditor.tEditor = this;
     TEditor.TEditorOpen = true;
     if (this.trans != null)
     {
         this.textBox1.Text = this.trans.Title;
         this.richTextBox1.Text = this.trans.Text;
         this.checkBox1.Checked = this.trans.Unformatted;
         this.panel1.Enabled = !this.trans.Unformatted;
     }
     else
     {
         this.textBox1.Text = "";
         this.richTextBox1.Text = "";
     }
 }
Example #25
0
		/// <summary>
		/// Initializes a new instance of <see cref="UndoPopup"/>.
		/// </summary>
		/// <param name="undoManager">The undo manager used to populate the action list.</param>
		/// <param name="mode">The mode the popup shows actions for.</param>
		public UndoPopup(UndoManager undoManager, UndoPopupMode mode)
			: base(new Control())
		{
			// Set some defaults on the host control.
			Control.Margin = Padding.Empty;
			Control.Size = new Size(400, 300);
			Control.TabStop = false;

			// Add the listbox.
			_listBox = new ListBox
			{
				Dock = DockStyle.Fill,
				BorderStyle = BorderStyle.None,
				IntegralHeight = false,
				SelectionMode = SelectionMode.MultiSimple,
				HorizontalScrollbar = true
			};
			_listBox.MouseDown += ListBox_MouseDown;
			_listBox.MouseMove += ListBox_MouseMove;

			Control.Controls.Add(_listBox);

			// Create tooltip.
			_tooltip = new ToolTip();

			_mode = mode;
			UndoManager = undoManager;
		}
 public AddPropertyForm(ListBox.ObjectCollection availablePropsList)
 {
     InitializeComponent();
     foreach (InstallerProp installerProp in availablePropsList) {
         installerProps.Add(installerProp);
     }
 }
Example #27
0
        private ChemtoolsGui()
        {
            this.Text = "ChemTools";
            this.Size = new Size(640, 640);

            input = new TextBox();
            input.Location = new Point(20, 20);
            input.Size = new Size(250, 20);
            input.TextChanged += new EventHandler(InputChanged);
            input.KeyDown += new KeyEventHandler(InputKeyDown);

            output = new RichTextBox();
            output.Location = new Point(50, 160);
            output.Size = new Size(250, 300);

            savedList = new ListBox();
            savedList.Location = new Point(300, 20);
            savedList.Size = new Size(300, 120);
            savedList.SelectedIndexChanged += new EventHandler(ListSelectChange);
            savedList.KeyDown += new KeyEventHandler(ListKeyDown);
            savedList.BeginUpdate();
            savedList.Items.Add("H2O");
            savedList.Items.Add("CO2");
            savedList.Items.Add("C4H10+O2=CO2+H2O");
            savedList.Items.Add("44.0095gCO2");
            savedList.EndUpdate();

            savedOutput = new RichTextBox();
            savedOutput.Location = new Point(300, 160);
            savedOutput.Size = new Size(250, 300);

            btnAdd = new Button();
            btnAdd.Location = new Point(180, 50);
            btnAdd.Text = "Save";
            btnAdd.Click += new EventHandler(AddClick);

            btnDelete = new Button();
            btnDelete.Location = new Point(180, 100);
            btnDelete.Text = "Delete";
            btnDelete.Click += new EventHandler(DeleteClick);

            btnClear = new Button();
            btnClear.Location = new Point(20, 50);
            btnClear.Text = "Clear";
            btnClear.Click += new EventHandler(ClearClick);

            btnReset = new Button();
            btnReset.Location = new Point(20, 100);
            btnReset.Text = "Reset All";
            btnReset.Click += new EventHandler(ResetClick);

            this.Controls.Add(input);
            this.Controls.Add(output);
            this.Controls.Add(savedList);
            this.Controls.Add(savedOutput);
            this.Controls.Add(btnAdd);
            this.Controls.Add(btnDelete);
            this.Controls.Add(btnClear);
            this.Controls.Add(btnReset);
        }
Example #28
0
 public NewSymbolDialog(ListBox symbols, FinancialCalculator calcualtor)
 {
     this.symbols = symbols;
     this.calculator = calcualtor;
     this.InitializeComponent();
     this.UpdatePreview();
 }
 public void CargarLista(ListBox lst)
 {
     IList ListarTerminales = GetAll();
     lst.DisplayMember = "terminal";
     lst.ValueMember = "id_terminal";
     lst.DataSource = ListarTerminales;
 }
Example #30
0
        public TabButtonControl()
            : base()
        {
            tabButtons = new ListBox();
            tabPanels = new ArrayList();
            tabTexts = new ArrayList();
            tabBitmaps = new ArrayList();

            tabButtons.Dock = DockStyle.Left;
            tabButtons.Font = new Font("Tahoma", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0)));
            tabButtons.Location = new Point(0, 0);
            tabButtons.Name = "tabButtons";
            tabButtons.Size = new Size(72, 264);
            tabButtons.DrawMode = DrawMode.OwnerDrawVariable;
            tabButtons.DrawItem += new DrawItemEventHandler(tabButtons_DrawItem);
            tabButtons.MeasureItem += new MeasureItemEventHandler(tabButtons_MeasureItem);
            tabButtons.SelectedIndexChanged += new EventHandler(tabButtons_SelectedIndexChanged);
            tabButtons.SizeChanged += new EventHandler(tabButtons_SizeChanged);

            tabButtons.BackColor = SystemColors.ControlDark;
            tabButtons.ForeColor = Color.White;

            contentPanel = new Panel();
            contentPanel.Dock = DockStyle.Fill;

            Controls.Add(contentPanel);

            Controls.Add(tabButtons);

            tabButtonsHasVScrollBar = false;
        }