C # DesignerVerb Tooltip - PullRequest
       15

C # DesignerVerb Tooltip

0 голосов
/ 27 апреля 2011

У меня есть DesignerVerb, который помещается на лист свойств, и мне было интересно, можно ли получить всплывающую подсказку при наведении мыши, чтобы описать, что он делает?

РЕДАКТИРОВАТЬ Вот код, который я использую для добавления глаголов.

public override DesignerVerbCollection Verbs
      {
         get
         {
            DesignerVerbCollection verbs = new DesignerVerbCollection();
            verbs.Add(new DesignerVerb("Load Attached Model", delegate(object sender, EventArgs e)
               {
                  if (System.IO.File.Exists(this.MxModelFilePath)) this.LoadModel(this.MxModelFilePath);
                  else System.Windows.Forms.MessageBox.Show("The program has not yet been attached to the model. Please click \"Re-Attach to Model\" to attach the program to the Simulink model.");
               }));
            verbs.Add(new DesignerVerb("Edit Original Model", delegate(object sender, EventArgs e)
               {
                  if (this.LoadModel(this.myModelFilePath)){

                     if (System.Windows.Forms.MessageBox.Show("You have opened the original model for editing. When you are finished, click \"OK\" to re-attach to the model immediately, or \"Cancel\" to re-attach the model at a later time.", "", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.OK)
                     {
                        if (System.IO.File.Exists(this.MxModelFilePath)) System.IO.File.Delete(this.MxModelFilePath);
                        this.ResyncWithSimulink();
                     }
                  }
               }));
            verbs.Add(new DesignerVerb("Close Model", delegate(object sender, EventArgs e)
               {
                  if (this.myMatlabInterface != null) this.myMatlabInterface.CloseSystem(this.myFailures);
               }));
            verbs.Add(new DesignerVerb("Re-Attach to Model", delegate(object sender, EventArgs e)
               {
                  if (System.IO.File.Exists(this.MxModelFilePath)) System.IO.File.Delete(this.MxModelFilePath);
                  this.ResyncWithSimulink();
               }));
            return verbs;
         }
      }

1 Ответ

0 голосов
/ 28 апреля 2011

Используйте атрибут Description.Он будет показан в области описания, а не в виде всплывающей подсказки, но я верю, что так оно и было.

...