 |
|
 |
how add RightToLeft Support to Ballon?
|
|
|
|
 |
|
|
 |
|
 |
Perfect work!!!
In my project, I add a property named 'HideOnLeave' to this control.
In the end of method 'Show()', if 'HideOnLeave' is true, I bind 'LostFocus' and 'Disposed' events to the parent-control. And then Remove the events in it.
And also, I expect to know how to get this feature: under title is empty, the text is not empty and the icon is not none. Show the icon with text in the same line without being bold.
modified on Thursday, May 19, 2011 2:50 AM
|
|
|
|
 |
|
|
 |
|
 |
I tried to display the balloon tooltip progammtically by sending message to it with TTM_POPUP - SendMessage(m_tool.Handle, TTM_POPUP, 0, 0), but it didn't work.
Any suggestions? Thanks.
|
|
|
|
 |
|
 |
hi,
I'm using this code (FMSEditTip.vb) and it works fine. I have only one problem: I have textbox1 on form1. UseSystemPasswordChar=true for textbox1 because it is a password field. When I write in this textbox and caps lock is on always appears the windows warning balloon. I want to disable system's balloon and use mine instead.
I copied the code in my project and my balloon appears properly when caps lock is on. Windows' balloon also appears so I have 2 balloons at the same time. So how to disable windows' balloon??
|
|
|
|
 |
|
 |
I am using windows 7 64bit when I run this project, before tooltip would appear it simply crashes every time.
any fixes?
|
|
|
|
 |
|
 |
I also use this code on W7 64bit, and works fine!
Have you got any error messages?
|
|
|
|
 |
|
 |
I get the same error, when running in 64bit Vista or Windows 7. (same code works great in 32bit)
There is no Debug information that i can find useful because it crashes the process from the system and doesn't get caught by .net at any level and i can't figure out o/s debug information for the life of me, but i can tell you at what line of code it crashes on:
Inside FMSMessageTip:
Private Sub Display(ByVal show As Integer)
Dim ptrStruct As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ti))
Marshal.StructureToPtr(ti, ptrStruct, True)
SendMessage(m_tool.Handle, TTM_TRACKACTIVATE, show, ptrStruct)
Marshal.FreeHGlobal(ptrStruct) End Sub
I know very very little on how "Marshal" works, perhaps the Allocated memory size needs to be bigger? Any help would be greatly appreciated why would a 32 bit application work vs a 64bit application.
HACKED FIX
Project Settings -> Compile Options -> Advanced Compile Options... -> Target CPU x86
This will treat the program as 32bit program, and the bubbles appear without a problem! However, i would prefer keeping my program operating as a 64 bit program when on a 64bit machine. So if anyone can kindly make suggestions or provide a solution i would greately appreciate it!!!!!
Thanks
|
|
|
|
 |
|
|
 |
|
 |
Thanks! Been looking for a useful [working] example - this one works with VS 2008!
|
|
|
|
 |
|
 |
Verry usefull and easy to understand! thanks you mate
|
|
|
|
 |
|
 |
The MessageBalloon has the potential to stay put until you close it or the user closes it. That is good for longer messages.
Problem: If the user activates another app or clicks Next on a Wizard, the MessageBalloon stays right there, but now it's pointing at something else!
I know the HoverBalloon could be used, since it is built to kill itself after x seconds, but in that case, the programmer is trying to guess how fast the user can read!! For longer messages, the user is reading the message when it disappears. Not appropriate.
So, I've used a module-level variable to hold the ref to the MessageBalloon, so that when the user does something like bring another app to the front, I can kill the MessageBalloon. Unfortunately, I have to put code everywhere to kill the MessageBalloon, such as in the FormClosing event, or in other button_click events, etc. etc.
Has anyone found a better way to ensure that the MessageBalloon gets closed when the control it is pointing at becomes obscured or another app gets focus?
|
|
|
|
 |
|
 |
I suggest you looking into parent form events.
public MessageBalloon(Control parent)
{
m_parent = parent;
m_tool = new MessageTool();
m_tool.DeActivate += new DeActivateEventHandler(this.Hide);
Form parentForm = parent.FindForm();
parentForm.Deactivate += new EventHandler(ParentFormDeactivate_EventHandler);
parentForm.HandleDestroyed += new EventHandler(ParentFormDeactivate_EventHandler);
}
private void ParentFormDeactivate_EventHandler(object sender, EventArgs e)
{
Hide();
}
modified on Wednesday, August 19, 2009 9:33 AM
|
|
|
|
 |
|
 |
Looking at the code for the HoverBalloon, I don't see any clear way of setting the timeout for it to disappear. If the text is a bit longer, the user won't have time to read it before it's gone.
________
42 is definitely not the meaning of life.
I knew that when I turned 43.
|
|
|
|
 |
|
 |
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);
|
|
|
|
 |
|
 |
Thanks, sgennette,
I'm having a bit of trouble implementing your suggestion, can you show where you put the "SendMessage" call to implement this?
|
|
|
|
 |
|
 |
I put the code here;
Marshal.FreeHGlobal(ptrStruct);
SendMessage(
m_tool.Handle,
TTM_SETMAXTIPWIDTH,
0,
new IntPtr(m_maxWidth));
SendMessage(
m_tool.Handle,
TTM_SETDELAYTIME,
TTDT_AUTOPOP, 15000);
I'm still trying to understand these messages and where they should go. I have two labels that I'm using for the hover balloons and I can get one to work well but not both. Gotta figure it out.
|
|
|
|
 |
|
 |
I program in VB, and have used this project as a basis for a VB project.
When I include the code you have posted above, the HoverBalloon appears but disappears almost instantly.
Would you be inclined to have a look at my project and see if you can determine why this is? If so, please send me your email address to bobishkindaguy@hotmail.com and I'll send you a zip of the code.
Or if you prefer, please send me a zip of your working sample and I'll convert it to VB and see where mine differs.
Thanks very much.
Bob
|
|
|
|
 |
|
 |
Hey,
First - excellent post!
Second, while I managed to run the code from a WPF application and everything works, I see the balloon with no visual styles (and no X button as well).
Do you know how can I overcome this?
Thanks!
--sternr
|
|
|
|
 |
|
 |
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
|
|
|
|
 |