0

So I have made a GUI which I compiled as EXE. The GUI has several textboxes and UpDown controls. I am starting the GUI from different class and all works fine - I can change/update the controls, I receive proper events and so on. There is 1 very strange problem - the GUI does not accept andy Keyboard input.... nowhere - not in the upDown controls, not in the text boxes... nowhere. If I start the EXE separately from prompt, it DOES accept keyboard input, but when I start it from my other class/programm it does not.

in my other class what I do is this :

myGui form;
...
form    = new myGui();

form.Show();

Form is shown normally, I can interact with it and all is good, except I cannot enter anything with the keyboard. All controls are unlocked. (anyways when the GUI is started directly from prompt it works normally and accepts keyboard)

What could be the problem?

  • Can you put a link to a zip containing the project files, please? –  Jul 09 '20 at 13:03
  • 1
    When you run the EXE separately, the Form is displayed as a result of being passed to `Application.Run()`. What kind of application is your "different class"? – Idle_Mind Jul 09 '20 at 13:47
  • The other program is called Multicharts.NET Almost sure you never heard of it - basically I can create my own C# programs and run them there. That's where I start the gui from using form.Show(); Btw. If I use Application.Run(form) I have the keyboard inputs, but I lose access to all the controls ! Like they become invisible for Multicharts. – user12209348 Jul 09 '20 at 16:26
  • [How to post messages to an STA thread running a message pump?](https://stackoverflow.com/a/21684059/7444103) – Jimi Jul 09 '20 at 16:36
  • Check if the main thread is not locked performing some task on background. If it's happen it's normal you can perform any other task. – integer Jul 18 '20 at 23:56

0 Answers0