Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void LockControl(Control locked)
- {
- if (locked != null)
- {
- if ((locked.Parent != null) && (locked.Parent.Controls != null))
- {
- try
- {
- int num = (locked.Size.Height - 0x10) / 2;
- int num2 = 0;
- ResourceManager manager = new ResourceManager(typeof(MainForm));
- PictureBox box = new PictureBox();
- if (locked is TextBox)
- {
- num2 += 5;
- }
- else if (!(locked is CheckBox) && !(locked is RadioButton))
- {
- num2 = (locked.Size.Width - 0x10) / 2;
- }
- box.Cursor = Cursors.Help;
- box.Image = (Image) manager.GetObject("lockBox.Image");
- box.Size = new Size(0x10, 0x10);
- box.SizeMode = PictureBoxSizeMode.AutoSize;
- box.Click += new EventHandler(this.lockBox_Click);
- box.TabIndex = locked.TabIndex;
- box.TabStop = locked.TabStop;
- box.Location = new Point(locked.Location.X + num2, locked.Location.Y + num);
- box.Name = locked.Name + "LockBox";
- box.Tag = locked;
- box.Visible = true;
- locked.Parent.Controls.Add(box);
- locked.Parent.Controls.SetChildIndex(box, 0);
- this.m_LockBoxes.Add(box);
- }
- catch
- {
- }
- }
- locked.Enabled = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement