Constructor Chaining Order

后端 未结 3 1890
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 18:03

If you chain constructor calls using the syntax:

public frmConfirm(): this(1)

when is the overloaded constructor called? Also, can somebody

3条回答
  •  囚心锁ツ
    2020-12-29 18:39

    The this(1) constructor is called first.

    As far as your second question goes, because of the InitializeComponent and other issues with form inheritance, I'd suggest you use composition instead of inheritance.

提交回复
热议问题