Guest User

Untitled

a guest
Aug 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. How to change notification design from default to customized?
  2. watcher.Changed += new FileSystemEventHandler(watcher_Changed);
  3. watcher.Created += new FileSystemEventHandler(watcher_Created);
  4. watcher.Deleted += new FileSystemEventHandler(watcher_Deleted);
  5. watcher.Renamed += new RenamedEventHandler(watcher_Renamed);
  6.  
  7. private void watcher_Changed(object sender, FileSystemEventArgs e)
  8. {
  9. this.notifyIcon1.ShowBalloonTip(1, "File " + e.ChangeType, e.FullPath, ToolTipIcon.Info);
  10. }
  11.  
  12. private void watcher_Created(object sender, FileSystemEventArgs e)
  13. {
  14. this.notifyIcon1.ShowBalloonTip(1, "File " + e.ChangeType, e.FullPath, ToolTipIcon.Info);
  15. }
  16.  
  17. private void watcher_Deleted(object sender, FileSystemEventArgs e)
  18. {
  19. this.notifyIcon1.ShowBalloonTip(1, "File " + e.ChangeType, e.FullPath, ToolTipIcon.Info);
  20. }
  21.  
  22. private void watcher_Renamed(object sender, RenamedEventArgs e)
  23. {
  24. this.notifyIcon1.ShowBalloonTip(1, "File Renamed", e.OldFullPath + " renamed to " + e.FullPath, ToolTipIcon.Info);
  25. }
  26.  
  27. private void InitializeComponent()
  28. {
  29. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Alert));
  30. this.panel1 = new System.Windows.Forms.Panel();
  31. this.panel3 = new System.Windows.Forms.Panel();
  32. this.panel2 = new System.Windows.Forms.Panel();
  33. this.btnCancel = new System.Windows.Forms.PictureBox();
  34. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  35. this.panel1.SuspendLayout();
  36. this.panel2.SuspendLayout();
  37. ((System.ComponentModel.ISupportInitialize)(this.btnCancel)).BeginInit();
  38. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  39. this.SuspendLayout();
  40. //
  41. // panel1
  42. //
  43. this.panel1.Controls.Add(this.panel3);
  44. this.panel1.Controls.Add(this.panel2);
  45. this.panel1.Location = new System.Drawing.Point(0, 0);
  46. this.panel1.Name = "panel1";
  47. this.panel1.Size = new System.Drawing.Size(200, 60);
  48. this.panel1.TabIndex = 0;
  49. //
  50. // panel3
  51. //
  52. this.panel3.BackColor = System.Drawing.Color.Lime;
  53. this.panel3.Location = new System.Drawing.Point(0, 53);
  54. this.panel3.Name = "panel3";
  55. this.panel3.Size = new System.Drawing.Size(200, 5);
  56. this.panel3.TabIndex = 1;
  57. //
  58. // panel2
  59. //
  60. this.panel2.BackColor = System.Drawing.Color.Lime;
  61. this.panel2.Controls.Add(this.btnCancel);
  62. this.panel2.Controls.Add(this.pictureBox1);
  63. this.panel2.Location = new System.Drawing.Point(0, 0);
  64. this.panel2.Name = "panel2";
  65. this.panel2.Size = new System.Drawing.Size(200, 22);
  66. this.panel2.TabIndex = 0;
  67. //
  68. // btnCancel
  69. //
  70. this.btnCancel.Cursor = System.Windows.Forms.Cursors.Hand;
  71. this.btnCancel.Image = global::FolderChange.Properties.Resources.Cancel;
  72. this.btnCancel.Location = new System.Drawing.Point(178, 3);
  73. this.btnCancel.Name = "btnCancel";
  74. this.btnCancel.Size = new System.Drawing.Size(16, 16);
  75. this.btnCancel.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
  76. this.btnCancel.TabIndex = 2;
  77. this.btnCancel.TabStop = false;
  78. this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
  79. //
  80. // pictureBox1
  81. //
  82. this.pictureBox1.Image = global::FolderChange.Properties.Resources.favicon9;
  83. this.pictureBox1.InitialImage = null;
  84. this.pictureBox1.Location = new System.Drawing.Point(4, 3);
  85. this.pictureBox1.Name = "pictureBox1";
  86. this.pictureBox1.Size = new System.Drawing.Size(16, 16);
  87. this.pictureBox1.TabIndex = 1;
  88. this.pictureBox1.TabStop = false;
  89. //
  90. // Alert
  91. //
  92. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  93. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  94. this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
  95. this.ClientSize = new System.Drawing.Size(200, 60);
  96. this.Controls.Add(this.panel1);
  97. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
  98. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  99. this.MaximizeBox = false;
  100. this.MinimizeBox = false;
  101. this.Name = "Alert";
  102. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  103. this.Text = "Alert";
  104. this.Load += new System.EventHandler(this.Alert_Load);
  105. this.panel1.ResumeLayout(false);
  106. this.panel2.ResumeLayout(false);
  107. this.panel2.PerformLayout();
  108. ((System.ComponentModel.ISupportInitialize)(this.btnCancel)).EndInit();
  109. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  110. this.ResumeLayout(false);
  111.  
  112. }
Add Comment
Please, Sign In to add comment