How can I execute code after my form starts?

后端 未结 5 1453
庸人自扰
庸人自扰 2020-12-11 19:56

I\'m really new to Windows Forms programming and not quite sure what\'s the right way to go about programming.

This is my confusion.

I have a single form:

5条回答
  •  没有蜡笔的小新
    2020-12-11 20:24

    You are missing the concept. In a Windows Forms Application, your Main Thread is responsible for running the Form.

    You can always use more Threads, but in Windows Forms I would recommend using a BackgroundWorker Component for parallel Tasks: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

    Or a Timer: http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx

提交回复
热议问题