解决方案 »
- treeView设置selectedNode失败。”=“两边的节点在执行完后不相等。
- DropDownList 的问题
- 界面上N多控件的缩放该然后实现·················
- [求助]关于操作Excel的问题?
- [求助]DataGrid绑定数据源中类型为DateTime的数据,为什么显示出来后时间没了。
- 我在向一个表格中插入一条记录时,这条记录有某个字段带有特殊符号 '所以在插入时老是说语法有问题,请问怎么解决啊?
- C#调用C++DLL结构体内含数组类型转换
- 这样开价为什么不好找?是我错了吗?
- How to drag-drop a picture box?
- listbox 的一个小问题 急!!
- c# 十进制数如何转化为BCD码
- 急,桌面勾取系统桌面的鼠标事件
{
....
}
这里面问题。
这种NullReference问题,他提示你的地方设个断点调试就知道!
并不是这样的,我这样写,public void form_load()
{
m_userlist users = new m_userlist();
users.userlist_load(d_userlist);
}也照样是提示: 未处理 System.NullReferenceException
Message="未将对象引用设置到对象的实例。"
Source="中影会员卡"
StackTrace:
在 中影会员卡.m_useredit.b_save_Click(Object sender, EventArgs e) 位置 C:\middlemovie\中影会员卡\m_useredit.cs:行号 172
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
在 System.Windows.Forms.Form.ShowDialog()
在 中影会员卡.m_usermange.b_edit_Click(Object sender, EventArgs e) 位置 C:\middlemovie\中影会员卡\m_usermange.cs:行号 51
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)
在 System.Windows.Forms.Button.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 中影会员卡.Program.Main() 位置 C:\middlemovie\中影会员卡\Program.cs:行号 29
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
public void form_load()
{
formload();
}
改成
public void form_load()
{
m_userlist users = new m_userlist();
users.userlist_load(d_userlist);
}
那不是跟没改一样么。关键是你在m_useredit.cs中不能调用m_usermange.cs中的load事件处理函数