/propertyGrid1.cs Secret
Created
March 7, 2024 22:02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Windows.Forms; | |
namespace PropertyGrid_Ornegi | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
List<Control> tumNesneler = new List<Control>(); | |
private void Form1_Load(object sender, EventArgs e) | |
{ | |
foreach (Control control in this.Controls) | |
{ | |
tumNesneler.Add(control); | |
} | |
foreach (var item in tumNesneler) | |
{ | |
comboBox2.Items.Add(item.Name + ":" + item.GetType().Name); | |
} | |
comboBox1.DataSource = tumNesneler; | |
} | |
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) | |
{ | |
Control secilenNesne = (Control)comboBox1.Items[comboBox2.SelectedIndex]; | |
string nesneAdi = secilenNesne.Name; | |
string nesneCinsi = secilenNesne.GetType().Name; | |
propertyGrid1.SelectedObject = secilenNesne; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment