Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
W

wangier

@wangier
About
Posts
21
Topics
9
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to reject the invalid row adding to datatable?
    W wangier

    It's OK, Thanks lot! ^|^

    C# help tutorial question

  • how to reject the invalid row adding to datatable?
    W wangier

    I did that. And I throw a ErrorDataRowException which inherits from Application in the data table's RowChanging event. But when the ErrorDataRowException is thrown, the application didnot enter the method UnHandledExceptionHandler. Instead, the application still popup an window in which told me there is an unhandled exception. why? pls help me. [STAThread] static void Main() { AppDomain currentAppDomain = AppDomain.CurrentDomain; currentAppDomain.UnhandledException += new UnhandledExceptionEventHandler(UnHandledExceptionHandler); FormRegisterConsole fmMain = new FormRegisterConsole(); Application.Run(fmMain); } private static void UnHandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception) args.ExceptionObject; if (e.GetType() == typeof(Health.ApplicationLibrary.RIS.Register.ErrorDataRowException)) { MessageBox.Show(e.Message, "data updating", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show("出现未处理错误: " + e.Message, "未处理错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }

    C# help tutorial question

  • how to prevent changing columns' width in datagrid?
    W wangier

    thanks!

    C# tutorial question

  • how to reject the invalid row adding to datatable?
    W wangier

    But if I don't throw the exception in RowChaging event, i can't prevent the new row to be added to the data table. Or some way to do that?

    C# help tutorial question

  • how to reject the invalid row adding to datatable?
    W wangier

    dataTable1.RowChaging += new DataRowChangeEventHandler(dataTable1_rowChaing) private void dataTable1_RowChanging(object sender, DataRowChangeEventArgs e) { if ( e.Action == DataRowAction.Add ) { if (...) throw new ApplicationException("不合法的检查项目!"); } } ------------ the problem is : this dataTable is associated to a datagrid, when add a new row through the datagrid, the rowchanging event can be trigered. If the row is invalid, the exception will be throwed, and the new row cannot be added to the dataTable1. But when should I handle this Exception? I can't catch this exception.

    C# help tutorial question

  • how to prevent changing columns' width in datagrid?
    W wangier

    how to prevent changing columns' width in datagrid?

    C# tutorial question

  • how to get the indexes of selected items in DataGrid?
    W wangier

    The DataGrid support multi-selection operations. But when I have multi-selected some rows, How can I determine which rows have been selected?

    C# question tutorial

  • How can I get graphics through message WM_NCPAINT ?
    W wangier

    I found that there is not difference between WndProc and DefWndProc. Sometimes the WM_NCPAINT 's wParam is 1. In this case, it will not be successful to create a Region. I found the graphics retrived not the same between IntPtr hdc = GetWindowDC(m.HWnd) Graphics g = Graphics.FromHDC(hdc) and Graphics g = Graphics.FromHWnd(hdc)

    C# question graphics

  • Painting the title bar
    W wangier

    Please check following codes, it dosen'g work properly, the title bar is still empty. ( the method PanitNonClientArea(Graphics, RectangleF) can work properly. ) protected override void WndProc(ref Message m) { Graphics g; RectangleF rectf; Point pt; switch (m.Msg) { case WMConsts.WM_NCPAINT : IntPtr hrgn = m.WParam; if ( hrgn != (IntPtr)1 ) { Region rgn = Region.FromHrgn(hrgn); g = CreateGraphics(); rectf = rgn.GetBounds(g); PaintNonClientArea(g, rectf); } else { g = CreateGraphics(); rectf = new RectangleF(0,-23, Width, 23); PaintNonClientArea(g, rectf); g.Dispose(); } //base.WndProc(ref m); break; default : base.WndProc (ref m); break; } }

    C# graphics

  • How can I get graphics through message WM_NCPAINT ?
    W wangier

    Please check following codes, it dosen'g work properly, the title bar is still empty. ( the method PanitNonClientArea(Graphics, RectangleF) can work properly. ) protected override void WndProc(ref Message m) { Graphics g; RectangleF rectf; Point pt; switch (m.Msg) { case WMConsts.WM_NCPAINT : IntPtr hrgn = m.WParam; if ( hrgn != (IntPtr)1 ) { Region rgn = Region.FromHrgn(hrgn); g = CreateGraphics(); rectf = rgn.GetBounds(g); PaintNonClientArea(g, rectf); } else { g = CreateGraphics(); rectf = new RectangleF(0,-23, Width, 23); PaintNonClientArea(g, rectf); g.Dispose(); } //base.WndProc(ref m); break; default : base.WndProc (ref m); break; } }

    C# question graphics

  • How can I get graphics through message WM_NCPAINT ?
    W wangier

    I found the graphics using Control.CreateGraphics only contains the client area, not contains the title bar.

    C# question graphics

  • How to get title bar's graphics or its retangle?
    W wangier

    I can get the form's graphics with CreateGraphics(). But how can I get the title bar's graphics? or How to determine the title bar's retangle? The wParam gotten from WM_NCPAINT always is 1.

    C# question graphics tutorial

  • How can I get graphics through message WM_NCPAINT ?
    W wangier

    I know I can get the form's graphics with CreateGraphics(). Can I get the title bar's graphics? or How can I determine the title bar's retangle? The wParam gotten from WM_NCPAINT always is 1.

    C# question graphics

  • How can I get graphics through message WM_NCPAINT ?
    W wangier

    For repainting the nonclient area myself, I process the message WM_NCPAINT. But the value got from wParam always is 1. Why? How can I get the nonclient area's graphics?

    C# question graphics

  • the components's comment
    W wangier

    e.g. System.Windows.Forms.Button in system.windows.forms.dll I have not found the corresponding file system.windows.forms.xml .

    C# question help

  • How can I repait the Caption area?
    W wangier

    How can I repait the Caption area of a window customized? I can't get the graphics of caption area.

    C# question graphics

  • the components's comment
    W wangier

    I found that there is not a .xml document corresponds to .net library which involving .net classes. How does these library do that?

    C# question help

  • the components's comment
    W wangier

    Thanks for your help!

    C# question help

  • How to set the TypeConverter of a Control?
    W wangier

    I got it. Thank you!

    C# question csharp c++ dotnet graphics

  • the components's comment
    W wangier

    In the object browser, the comments of a class or its member's summary and parameters can be displayed at the bottom of the window (these comments use "///"). When I compile the project to a .dll, reference this .dll into another solution, the comments of the classes in this .dll can't displayed in object browser. Why? How can I fix it?

    C# question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups