 |
|
 |
How to do it for richtextbox, rather than normal textbox.
|
|
|
|
 |
|
 |
This is a good control.
However, I need to show the tooltip when user enters invalid data in a control. The best option for me would be edit tooltip. But when the control's validating event is cancelled, other controls are still working. Note that I have placed my control in a tab page. Its buttons are unexpectedly firing their events, but the tab pages and the form's close button are not working which is a desired behavior.
Any clue!
|
|
|
|
 |
|
 |
I am using the a command button to trigger the show method of the edit tool tip. However the tooltip quickly appears and dissapears.
However, if i invoke the CommandButtun_Click even from the main menu the tooltip stays.
Any ideas?
|
|
|
|
 |
|
 |
I also notice it does't work with other controls such as combobox and datepicker.
|
|
|
|
 |
|
 |
Great Stuff Man!!! Here a new feature for you:;P
Since Microsoft Windows XP Service Pack 2 (SP2) and later you can add a custom Icon. In this way:
Icon should be 16 x 16 ....
CLIENT:
mTip.Icon = this.Resourcer.LoadIcon("_1616").Handle
COMPONENT:
private IntPtr mIcon;
public IntPtr Icon
{
get { return mIcon; }
set { mIcon = value; }
}
SendMessage(
mTool.Handle, TTM_SETTITLE,
(int)mIcon, ptrTitle);
Cheers to the Community
Nicola
|
|
|
|
 |
|
 |
Hi,
It is possible to show the balloon message over a determinate character inside a richtextbox?
Thanks!
|
|
|
|
 |
|
 |
When you click twice on "Message Balloon"/"Show Tip" the tip does not get closed after clicking "Hide Tip", even the close button on the tip does not work any more...
A comparable problem occurs when you click "Hide Tip" without ever having clicked "Show Tip".
H. Salomons
|
|
|
|
 |
|
 |
Has someone implemented a timeout option .... like I want the balloon to close after 5 seconds. any tip/url?
|
|
|
|
 |
|
 |
Easy! Add this code in the balloon you want to auto-close:
private System.Windows.Forms.Timer timerToClose;
public MessageBalloon()
{
...
this.timerToClose = new Timer();
this.timerToClose.Interval = 5000; //Interval (ms)
this.timerToClose.Tick += new System.EventHandler(this.timerToClose_Tick);
this.timerToClose.Enabled = true;
}
private void timerToClose_Tick(object sender, System.EventArgs e)
{
this.Hide();
this.timerToClose.Enabled = false;
}
Quite simple, isn't it?
|
|
|
|
 |
|
 |
I tried using the code you gave but it didn't work.
Here's what I found that did work for setting the ballon duration to 10 seconds:
public const int TTM_SETDELAYTIME = (WM_USER + 3);
public const int TTDT_AUTOPOP = 2;
[DllImport("User32", EntryPoint = "SendMessageA", SetLastError = true)]
public static extern int SendMessage(
IntPtr hWnd,
int Msg,
long wParam,
long lParam);
SendMessage(
m_tool.Handle,
TTM_SETDELAYTIME,
TTDT_AUTOPOP, 10000);
|
|
|
|
 |
|
 |
I am using DotNet v1.1. there seems to be strange problem with OpenFIleDialog, SaveFileDialog and FolderBrowseDialog. When I show a ballon tooltip and one of the dialog is also displayed, a strange NullReferenceException creeps in. I have tried to hide and dispose the ballon tooltip before opening the dialog. Any suggestions?
-Kashif
|
|
|
|
 |
|
 |
I had exactly the same problem, i've identified the problem to be in the SetToolTip() method
---> SendMessage(
m_tool.Handle,
TTM_ADDTOOL,
0,
ptrStruct);
NULL REFERENCE EXCEPTION !!
Can anyone figure it out ??
|
|
|
|
 |
|
|
 |
|
 |
Please look at the dates posted. It looks like MSDN has copied the code from this article! I posted this in Sept 2003 and the MSDN article is from March 2006. Having said that I do acknowledge there are bugs in the article and that I havent been able to getting to fix them. I appreciate the community effort in fixing them. Thank you everybody.
|
|
|
|
 |
|
 |
There is a bug in the Show method of the EditBalloon class. This causes an intermitent AccessViolaitonException under the .NET Framework 2.0.
The offending lines are:
IntPtr ptrStruct = Marshal.AllocHGlobal(Marshal.SizeOf(ebt));
Marshal.StructureToPtr(ebt, ptrStruct, true);
The second line should be:
Marshal.StructureToPtr(ebt, ptrStruct, false);
You cannot instruct Marshal.StructureToPtr to delete the previously used buffer, since the buffer has not been previously used. The line before this line allocates a new buffer, which contains unpredictable data. This causes the AccessViolationException to occur intermitently.
From MSDN:
If the fDeleteOld parameter is true, the buffer originally pointed to by ptr is deleted with the appropriate delete API on the embedded pointer, but the buffer must contain valid data.
The important part of that is "but the buffer must contain valid data" - you cannot delete an uninitialized buffer.
|
|
|
|
 |
|
 |
I'm using this component in an application and all went fine until I tried using the application in Windows Vista, where the application opened fine but, after a while, stopped working (never in the same place of the execution stack).
After a few hours of debugging I came back to the component's page in Code Project and began looking through the messages until I found this one. I corrected de component's source code and the application no longer stopped working in Windows Vista.
Thanks for the tip.
|
|
|
|
 |
|
 |
How can i hide the EditBalloon?
I want to use this in some sort of advanced ErrorProvider...because i don't like the one in .NET,
you have to hover the mouse over the small icon of the provider.
So I show the tooltip when there is an error and hide the tooltip if the control was validated.
Thank you,
K
-- modified at 8:54 Tuesday 14th February, 2006
|
|
|
|
 |
|
 |
I got it...
I'll use SendMessage with EM_HIDEBALLOONTIP...
|
|
|
|
 |
|
 |
It does not seem to work on XP
The code complies okay...but seem to be not enabled.
Any suggestion?.
Electronic Engineer keen to learn more of C# and .net programming. Currently using C and C++ for microcontroller application.
|
|
|
|
 |
|
 |
As I had the same issue... It could be of help:
You need to remove the following DWORD key in the registry (probably setting it to 1 is also fine) to have the balloons working:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\EnableBalloonTips
|
|
|
|
 |
|
 |
I was looking to use this code as a tray application notifier. Unfortunately it does not work in that way. Problem is when we want to pass the handle from the NotifyIcon to the HoverBallon object. Do you have any idea how to fix it?
rent0n
|
|
|
|
 |
|
 |
How do i create a Right to Left Ballon?
could you please help me?
|
|
|
|
 |
|
 |
Hello
I have this problem too.
Can anybody help me about this.
Thank you.
|
|
|
|
 |
|
 |
Thanks for the great article, to update the balloon text I’ve added the following property and constants in FMSBalloonTips.cs:
private const int TTM_UPDATETIPTEXT = WM_USER + 57;
private Control m_parent = null;
public void SetToolTip(Control parent, string tipText)
{
System.Diagnostics.Debug.Assert(parent.Handle!=IntPtr.Zero, "parent hwnd is null", "SetToolTip");
m_parent = parent;
...
}
public string Text {
get {
return m_displayText;
}set {
m_displayText = value;
System.Diagnostics.Debug.Assert(m_parent.Handle !=IntPtr.Zero, "Parent control is null", "Set parent before updateing the Text");
TOOLINFO ti = new TOOLINFO();
ti.cbSize = Marshal.SizeOf(ti);
ti.hwnd = m_parent.Handle;
ti.hinst = m_tool.Handle;
ti.lpszText = m_displayText;
// update the tool tip text
IntPtr ptrStruct = Marshal.AllocHGlobal(Marshal.SizeOf(ti));
Marshal.StructureToPtr(ti, ptrStruct, true);
SendMessage(
m_tool.Handle,
TTM_UPDATETIPTEXT,
0,
ptrStruct);
ti = (TOOLINFO)Marshal.PtrToStructure(ptrStruct, typeof(TOOLINFO));
Marshal.FreeHGlobal(ptrStruct);
}
}
|
|
|
|
 |
|
 |
I am able to run the C# demo and found the suggested registry setting was unneccessary for WinXP. I followed the instruction to add Application.EnableVisualStyles() to the constructor of the parent form. The application does not run as a standalone app but is started through a reflection call so I had to add this to the constructor instead of to Main.
However, when I import FMSMessageTip.cs into my project I am unable to get the Close box to appear and the style of the icon is not WinXP. WndProc also never receives a left mouse button down message. Any ideas anyone?
Terrel
|
|
|
|
 |