开发者

C# DesignerVerb Tooltip

开发者 https://www.devze.com 2023-03-01 07:06 出处:网络
I have a DesignerVerb that gets placed on a property sheet and was wonderin开发者_JS百科g if it\'s possible to get a mouseover tooltip to describe what it does?

I have a DesignerVerb that gets placed on a property sheet and was wonderin开发者_JS百科g if it's possible to get a mouseover tooltip to describe what it does?

EDIT Here is the code I am using to add the verbs.

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;
         }
      }


Use the Description attribute. It will be shown in the description area, not as tooltip, but i believe that's the way it's designed to be.

0

精彩评论

暂无评论...
验证码 换一张
取 消