TheSwamp
Code Red => .NET => Topic started by: sinc on February 15, 2008, 06:20:26 PM
-
Has anyone tried implementing pop-up help on .NET forms in Autocad?
I'm trying to get balloons to pop open when the user hovers the mouse over a control, but I'm not sure how to proceed. I can't get a HelpProvider to work, but from the description, it sounds like I don't even want that style of help, even if I could get it to work. From the description, it sounds like a HelpProvider expects the user to hit F1 to see any of the pop-up balloons, and that's not what I want. I'm trying to get balloons to popup automatically, just from a mouse hover.
-
You need to look at input point monitor. You can start on this post, and read for a couple of pages. (http://www.theswamp.org/index.php?topic=18121.msg241642#msg241642) As far as having a bubble pop up, I never got that to work, and I don't think Glenn posted a solution for that either.
-
Richard,
do you mean
HelpProvider
or ToolTips
Tim
I think sinc is after balloons on the form, not on Acad entities.
-
Something like ...
using WinForms = System.Windows.Forms;
using FormBalloonTest;
[assembly: AcRx.CommandClass(typeof(kdub.Testing.Commands.TestCommands))]
namespace kdub.Testing.Commands
{
/// <summary>
/// Summary description for TestCommands Class.
/// </summary>
public class TestCommands
{
public TestCommands()
{ //
// TODO: Add constructor logic here
//
}
[AcRx.CommandMethod("Cmd1")]
static public void test()
{
TestFormForBalloons testForm = new TestFormForBalloons();
Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(testForm);
}
}
}
namespace FormBalloonTest
{
public partial class TestFormForBalloons : Form
{
public TestFormForBalloons()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void TestFormForBalloons_Load(object sender, EventArgs e)
{
ToolTip toolTip01 = new ToolTip();
toolTip01.AutoPopDelay = 4000;
toolTip01.InitialDelay = 1000;
toolTip01.ReshowDelay = 500;
// Force the ToolTip text to display.
toolTip01.ShowAlways = true;
// Set up the ToolTip text.
toolTip01.SetToolTip(this.button1, "Press Me, Press me .... ");
toolTip01.SetToolTip(this.textBox1, "Add something inane to the textBox");
}
}
}
and the piccy ;
-
.. and ;
//<<<<<<<<<<
toolTip01.IsBalloon = true;
toolTip01.UseAnimation = true;
//>>>>>>>
-
The zipped Solution is attached, for anyone interested ..
-
Perfect! Thanks, Kerry. I got off on a wrong tangent trying to deal with that HelpProvider class, and didn't even see the ToolTip one.
-
I'm pretty sure that you can add the tooltip in the properties sheet in the form designer too, you could in VB/A from memory, may save some coding time :)
-
Yes, you can.
-
I'm pretty sure that you can add the tooltip in the properties sheet in the form designer too, you could in VB/A from memory, may save some coding time :)
I thought so too Mick, but couldn't see it when I went looking .. ;-) .. but there may be several reasons for that ..
-
It's in the Common Controls.
-
ahhh .. must be added from the Toolbox first ... too obvious :-)
-
ahhh .. must be added from the Toolbox first ... too obvious :-)
Well, not exactly obvious. Why is it in with the Common Controls? Since this component works in a very similar manner to the HelpProvider class, why isn't the ToolTip in the Component section with HelpProvider and the other components? It seems to me that this component is mis-categorized. If it had been in the Components section with the HelpProvider, I would have found it myself.
Although really I probably should have seen it anyway. After all, I've used a fair number of TextBoxes now, and the TextBox is right next to the ToolTip.