Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Balloon tips 1

Status
Not open for further replies.

153

Programmer
Mar 16, 2003
25
ID
Is it possible to use a tooltip but not in mouseover event? (Ex: click event)

I want to use it to show error messages.
Therefore, the user will know that he had provided a wrong info in that control.


thanks.

 
You could use the ErrorProvider control and set it as follows:

Code:
	Private Sub TextBox1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Validated

		ErrorProvider1.SetError(TextBox1, "")

	End Sub

	Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating

		If TextBox1.Text <> "Fred" Then
			e.Cancel = True
			ErrorProvider1.SetError(TextBox1, "Invalid Data")
		Else
			'not really necessary (I think), but better safe than sorry
			e.Cancel = False
			ErrorProvider1.SetError(TextBox1, "")
		End If

	End Sub

Hope this helps.

[vampire][bat]
 
I forgot to add that you need to make sure that the TextBox's CausesValidation property is set to True (this is the default setting, so it should already be set).

[vampire][bat]
 
Thanks earthandfire, It's work.

One more question. Did U know how to show that error message in balloon? Just like balloon tooltips (or if U use Win XP it will appears in system tray if U had file will be writen to CD).

Thanks.
 
Thanks ZmrAbdulla,

But, it's show in system tray. How to make it show on form control?

By the way I find another code (still in that site) to show tooltips in balloon form (use tooltips component with little coding).

But, Still search for showing that balloon messages in form control just with invoke "the show balloon command". Or may be we can make it work with error provider????

Any suggestion???

Thanks by the way..
 
May be form designed as ballon to show?
I am a .NET kid.. I can only just think like that [wink]

________________________________________________________
Zameer Abdulla
Help to find Missing people
Seek counsel of him who makes you weep, and not of him who makes you laugh.
 
Thanks to all of you,

I Will Try. I don't know that C# compiled dll can work in VB.Net. Thanks for your info.
 
Thanks.

Problem solved refer to that C# sample.
But, I cannot open the site that TipGiver suggest. It's return an error page.
Thanks to all of you and Special Thanks to Borvik.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top