stu nicholls dot com | menu - Professional dropdown #3

click here


ToolTip

Displays the information when the user moves the pointer over an associated control. In the following application a text is displayed when the user moves the pointer over the text box or over the button. You have to add the ToolTip control to the application from the tool box. The application is executed (Fig. 52 and Fig. 53).


Program to use ToolTip:

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ToolTip1.SetToolTip(TextBox1, "Enter Text Only")
ToolTip1.SetToolTip(Button1, "Click this When you are
Completed with the Task")
End Sub
End Class

Fig52


Fig53



TabControl

This control manages and displays to the user related collection of tabs that can contain controls and components. You can add TabControl from the tool box. Once you add TabControl you can set it’s properties. You can change the Text of the TabControl from default TabPage1 and TabPage2 to whatever you want.
In the following example, TabControl is added to the application which adds two Tab Pages by default. Then two labels, two text boxes and one button is added to each of the Tab Pages. The text of the Tab Pages is changed to Factorial and Fibanacci by using the TabPages property. The Fig. 54shows the TabPages Collection Editor using which you can change the text of the Tab Pages. Using TabPaged Collection Editor you can also add or remove TabPages which is shown in Fig. 55.

Fig54


Fig55



Program to use TabControl:

Public Class frmtabs
Private Sub btnfact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfact.Click
Dim n, i, fact As Integer
fact = 1
n = Integer.Parse(Me.TextBox1.Text)
For i = 1 To n
fact = fact * i
Next i
Me.TextBox2.Text = fact
End Sub

Private Sub btnfib_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfib.Click
Dim m, j, f1, f2, f3 As Integer
f1 = 0
f2 = 1
m = Integer.Parse(Me.TextBox3.Text)
Me.TextBox4.Text = f1 & ", " & f2
For j = 3 To m
f3 = f1 + f2
f1 = f2
f2 = f3
Me.TextBox4.Text &= ", " & f3
Next j
End Sub
End Class

The result after the execution of the application is shown in Fig. 56 and Fig. 57.

Fig56


Fig57



NotifyIcon:

This control displays an icon in the notification area on the right side of the windows taskbar, during run time.
In the following example NotifyIcon and one button is added to the application from the tools box which is shown in Fig.58. Property page for NotifyIcon is shwon in Fig. 59. When you execute the application you will get the screen as shown in Fig. 60. Click on the button you will get the screen as shown in Fig.61 Now click on the button shown in Fig. 61 you will get the screen as shown in Fig. 62.

Fig58



Fig59



Fig60



Fig61



Fig62



Program to use NotifyIcon:

Public Class Notify_Icon
Private Sub btnnotify_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnotify.Click
'Notify Icon Control is used to display an icon in the 'system tray.
' This control can be used to indicate the start and stop of 'an application or a process or a service.
'First the Visible property of the Control is set to false.
'Icon Image is loaded using the Icon property.
'Button control is used to enable the Notify Icon Control 'using the click event.
'Also shows Balloon Tip
MsgBox("See the System Tray there it shows the Notify Icon")
NotifyIcon1.Visible = True
NotifyIcon1.ShowBalloonTip(10, "Notify Started", "The Process with Notify Icon Started", ToolTipIcon.Info)
End Sub

Private Sub NotifyIcon1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseClick
NotifyIcon1.ShowBalloonTip(10, "Notify Started", "The Process with Notify Icon Started", ToolTipIcon.Info)
End Sub
End Class

<< Previous   Next>>


comments powered by Disqus
click here
click here
Footer1