C
C#8mo ago
Rorm

Finding a button by name

Hello I would like help with this:
private void LoadKeybinds()
{
string filePath = "edward.json";
using (StreamReader r = new StreamReader(filePath))
{
string json = r.ReadToEnd();
JObject keybinds = JObject.Parse(json);
foreach (var item in keybinds)
{
if (item.Key.Contains("Keybind"))
{
//find button for example in python: f"{item.Key}BTN" and change the button text to item.Value somehow

//MessageBox.Show(item.Key + ": " + item.Value);
}

}
}

}
private void LoadKeybinds()
{
string filePath = "edward.json";
using (StreamReader r = new StreamReader(filePath))
{
string json = r.ReadToEnd();
JObject keybinds = JObject.Parse(json);
foreach (var item in keybinds)
{
if (item.Key.Contains("Keybind"))
{
//find button for example in python: f"{item.Key}BTN" and change the button text to item.Value somehow

//MessageBox.Show(item.Key + ": " + item.Value);
}

}
}

}
I would like to find button by name and change the button text to item.Value somehow
1 Reply
MutableString
MutableString8mo ago
if it's winforms i guess you could search buttons in the form controls although i would prefer seeing something a little less dynamic
Want results from more Discord servers?
Add your server