exception in InitializeComponent of form

  • Thread starter Thread starter KNC
  • Start date Start date
K

KNC

hi,

We sometimes got exception in InitializeComponent of form, the
exception type is NullReferenceException, etc..
Any help?

Thanks in advance,
KNC
 
Hi Sergey,

Thanks for your answer but that's not the case. I know about the
limitation of 64 Kbs. This form is very simple, just about 6 combo, 1
button, 1 list view, 1 textbox, 2 menuitems, and about 8 labels.

Any help more?
KNC
 
Step into it to find out/use breakpoints. If the method is there, then it is
one of its lines that is causing the problem so find which one it is then
post here the method pointing out the offending line.

Cheers
Daniel
 
hi Daniel,

Sorry for tracking this thread very slow although I really need the
solution soon.
Below is detail of exception:

PDA.exe
frmLogin::set_cmdLogin+0x20
frmLogin::InitializeComponent+0x37
frmLogin::xctor=0x95
frmLogin::Main+0xa

And below is InitializeComponent function:

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.txtUserName = New System.Windows.Forms.TextBox
Me.lblUser = New System.Windows.Forms.Label
Me.lblPassword = New System.Windows.Forms.Label
Me.txtPassword = New System.Windows.Forms.TextBox
Me.cmdLogin = New System.Windows.Forms.Button
Me.cmdConfig = New System.Windows.Forms.Button
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.InputPanel1 = New Microsoft.WindowsCE.Forms.InputPanel
Me.timerLogMem = New System.Windows.Forms.Timer
'
'txtUserName
'
Me.txtUserName.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.txtUserName.Location = New System.Drawing.Point(88, 40)
Me.txtUserName.MaxLength = 6
Me.txtUserName.Size = New System.Drawing.Size(88, 19)
Me.txtUserName.Text = ""
'
'lblUser
'
Me.lblUser.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.lblUser.Location = New System.Drawing.Point(2, 42)
Me.lblUser.Size = New System.Drawing.Size(80, 16)
Me.lblUser.Text = "æ°åコード"
Me.lblUser.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'lblPassword
'
Me.lblPassword.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.lblPassword.Location = New System.Drawing.Point(10, 90)
Me.lblPassword.Size = New System.Drawing.Size(72, 16)
Me.lblPassword.Text = "パスワード"
Me.lblPassword.TextAlign =
System.Drawing.ContentAlignment.TopRight
'
'txtPassword
'
Me.txtPassword.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.txtPassword.Location = New System.Drawing.Point(88, 88)
Me.txtPassword.MaxLength = 8
Me.txtPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.txtPassword.Size = New System.Drawing.Size(88, 19)
Me.txtPassword.Text = ""
'
'cmdLogin
'
Me.cmdLogin.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.cmdLogin.Location = New System.Drawing.Point(32, 136)
Me.cmdLogin.Size = New System.Drawing.Size(72, 24)
Me.cmdLogin.Text = "ログイン"
'
'cmdConfig
'
Me.cmdConfig.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.cmdConfig.Location = New System.Drawing.Point(136, 136)
Me.cmdConfig.Size = New System.Drawing.Size(72, 24)
Me.cmdConfig.Text = "åˆæœŸè¨­å®š"
'
'timerLogMem
'
'
'frmLogin
'
Me.Controls.Add(Me.cmdConfig)
Me.Controls.Add(Me.cmdLogin)
Me.Controls.Add(Me.txtPassword)
Me.Controls.Add(Me.lblPassword)
Me.Controls.Add(Me.lblUser)
Me.Controls.Add(Me.txtUserName)
Me.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.MaximizeBox = False
Me.Menu = Me.MainMenu1
Me.MinimizeBox = False
Me.Text = "ログイン"

End Sub


Pls help me one more time.

KNC
 
So have you stepped into the method to locate which is the offending line
like I suggested? If you are going to post code you might as well post a
complete working sample (otherwise I have to compile your code in my
mind)...

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


hi Daniel,

Sorry for tracking this thread very slow although I really need the
solution soon.
Below is detail of exception:

PDA.exe
frmLogin::set_cmdLogin+0x20
frmLogin::InitializeComponent+0x37
frmLogin::xctor=0x95
frmLogin::Main+0xa

And below is InitializeComponent function:

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.txtUserName = New System.Windows.Forms.TextBox
Me.lblUser = New System.Windows.Forms.Label
Me.lblPassword = New System.Windows.Forms.Label
Me.txtPassword = New System.Windows.Forms.TextBox
Me.cmdLogin = New System.Windows.Forms.Button
Me.cmdConfig = New System.Windows.Forms.Button
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.InputPanel1 = New Microsoft.WindowsCE.Forms.InputPanel
Me.timerLogMem = New System.Windows.Forms.Timer
'
'txtUserName
'
Me.txtUserName.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.txtUserName.Location = New System.Drawing.Point(88, 40)
Me.txtUserName.MaxLength = 6
Me.txtUserName.Size = New System.Drawing.Size(88, 19)
Me.txtUserName.Text = ""
'
'lblUser
'
Me.lblUser.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.lblUser.Location = New System.Drawing.Point(2, 42)
Me.lblUser.Size = New System.Drawing.Size(80, 16)
Me.lblUser.Text = "æ°åコード"
Me.lblUser.TextAlign = System.Drawing.ContentAlignment.TopRight
'
'lblPassword
'
Me.lblPassword.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.lblPassword.Location = New System.Drawing.Point(10, 90)
Me.lblPassword.Size = New System.Drawing.Size(72, 16)
Me.lblPassword.Text = "パスワード"
Me.lblPassword.TextAlign =
System.Drawing.ContentAlignment.TopRight
'
'txtPassword
'
Me.txtPassword.Font = New System.Drawing.Font("MS PGothic",
9.0!, System.Drawing.FontStyle.Regular)
Me.txtPassword.Location = New System.Drawing.Point(88, 88)
Me.txtPassword.MaxLength = 8
Me.txtPassword.PasswordChar = Microsoft.VisualBasic.ChrW(42)
Me.txtPassword.Size = New System.Drawing.Size(88, 19)
Me.txtPassword.Text = ""
'
'cmdLogin
'
Me.cmdLogin.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.cmdLogin.Location = New System.Drawing.Point(32, 136)
Me.cmdLogin.Size = New System.Drawing.Size(72, 24)
Me.cmdLogin.Text = "ログイン"
'
'cmdConfig
'
Me.cmdConfig.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.cmdConfig.Location = New System.Drawing.Point(136, 136)
Me.cmdConfig.Size = New System.Drawing.Size(72, 24)
Me.cmdConfig.Text = "åˆæœŸè¨­å®š"
'
'timerLogMem
'
'
'frmLogin
'
Me.Controls.Add(Me.cmdConfig)
Me.Controls.Add(Me.cmdLogin)
Me.Controls.Add(Me.txtPassword)
Me.Controls.Add(Me.lblPassword)
Me.Controls.Add(Me.lblUser)
Me.Controls.Add(Me.txtUserName)
Me.Font = New System.Drawing.Font("MS PGothic", 9.0!,
System.Drawing.FontStyle.Regular)
Me.MaximizeBox = False
Me.Menu = Me.MainMenu1
Me.MinimizeBox = False
Me.Text = "ログイン"

End Sub


Pls help me one more time.

KNC
 
Back
Top