code_junkie

ListView Empty Markup Text

Nov 12th, 2011
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. protected override void WndProc(ref Message m) {
  2. try {
  3. if(m.Msg == 78 /* WM_NOTIFY */) {
  4. var nmhdr = (NMHDR)Marshal.PtrToStructure(m.LParam, typeof(NMHDR));
  5. if(nmhdr.code == -187 /* LVN_GETEMPTYMARKUP */) {
  6. var nmlvemptymarkup =
  7. (NMLVEMPTYMARKUP)Marshal.PtrToStructure(m.LParam, typeof(NMLVEMPTYMARKUP));
  8. nmlvemptymarkup.szMarkup = "The ListView is empty.";
  9. m.Result = (IntPtr)1;
  10. }
  11. }
  12. } finally {
  13. base.WndProc(ref m);
  14. }
  15. }
  16.  
  17. listview_onPaint(object sender, eventargs e)
  18. {
  19. if ( listview.items.count <= 0 )
  20. {
  21. e.graphics.drawstring("The Listview is empty"); //put all the proper args in here!
  22. }
  23. }
Add Comment
Please, Sign In to add comment