手上正在完成一个管理软件,有数据库连接和本地文件读取,想做一个加载界面等全部完成后显示,现在有一个问题:
我在Program类中定义了静态的数据库管理类(DB)和本地文件读取类(FILE) 程序启动Application.Run(new FrmMain());后在FrmMain的Load事件中显示一个加载界面(FrmLoad)的对话框模式,在FrmLoad中同时初始化并加载完成DB和File后登录,用户密码正确后FrmLoad的DialogResult.OK返回到FrmMain界面,到这里都没问题,但是在在FrmLoad中初始化的Program类中定义的静态DB和File到了FrmMain中使用就出现问题了用VisulStudio执行时没问题,单独运行编译后的可执行程序时也不报错就是不显示主界面了。请大家帮我分析下问题出在哪里?

解决方案 »

  1.   

    补充下出出错的问题:在 System.Drawing.BufferedGraphicsContext.CreateCompatibleDIB(IntPtr hdc, IntPtr hpal, Int32 ulWidth, Int32 ulHeight, IntPtr& ppvBits)
       在 System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
       在 System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
       在 System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
       在 System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
       在 System.Windows.Forms.Control.WmPaint(Message& m)
       在 System.Windows.Forms.Control.WndProc(Message& m)
       在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       在 System.Windows.Forms.ContainerControl.WndProc(Message& m)
       在 System.Windows.Forms.UserControl.WndProc(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)