Hi,
I made a plugin for K-Relay that uses a gui.
First of I hook a command with a method (of cource the command is in the GetCommands method).
Code:
proxy.HookCommand("command", doCommand);
Then the doCommand uses the PluginUtils to request the gui.
Code:
private void doCommand(Client client, string command, string[] args)
{
PluginUtils.ShowGUI(new FrmMyPlugIn(this));
}
The FrmMyPlugIn inherit from the Form class. It has a field _m that is a MyPlugIn. Constructor look something like this:
Code:
public FrmMyPlugIn(MyPlugIn m)
{
_m = m;
InitializeComponent();
}
I use properties in the MyPlugIn class to interract with the form like this:
Code:
private void UpDown_ValueChanged(object sender, EventArgs e)
{
NumericUpDown upDown = (NumericUpDown) sender;
_t.Number = (int)upDown.Value;
}
My problem is the GUI doesn't show when I do my /command