Richtextbox

1,741 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,741
On SlideShare
0
From Embeds
0
Number of Embeds
157
Actions
Shares
0
Downloads
51
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Richtextbox

  1. 1. PresentationOnTopic: Timer, ComboBox,Rich TextBox, Slider
  2. 2.  Timer Contol Combobox Rich Textbox SliderContents
  3. 3.  Timer Control Works like a stopwatch or alarm clock Timer control counts repeatedly as long as enabled property is set to true Interval: It specifies the interval between Timer events in millisecondsTimer Control
  4. 4. Timer Control Application
  5. 5.  Dim counter As Integer Private Sub cmdend_Click() Timer1.Enabled = False End Sub Private Sub cmdstart_Click() Timer1.Enabled = True End Sub Private Sub Timer1_Timer() counter = counter + 1 If counter = 95 Then counter = 1 End If If counter = 1 Then Shape1.FillColor = vbRed Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite End IfCoding
  6. 6.  If counter = 45 Then Shape1.FillColor = vbWhite Shape2.FillColor = vbYellow Shape3.FillColor = vbWhite End If If counter = 50 Then Shape1.FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbGreen End If End Sub
  7. 7. Output
  8. 8.  Features of Text box and List box It is used to present list to the User This control allow the user to select an item either by typing into the Combo box, or by selecting it from the list It contains an edit fieldCombo Box Control
  9. 9.  Three Styles Combo Box  The drop down combo Box  The Simple combo Box  The drop down listCombo Box Styles
  10. 10. Drop down Combo BoxStyle 0Simple Combo BoxStyle 1 Drop Down List Box Style 2
  11. 11. Form Design
  12. 12.  Coding  Dim a, b  Private Sub cmdshowdate_Click()  lblcombo.Caption = Combo2.Text + " " + Combo3.Text + "," + Combo4.Text  End Sub  Private Sub Combo1_click()  If Combo1.ListIndex = 0 Then  lblcombo.ForeColor = vbRed  End If  If Combo1.ListIndex = 1 Then  lblcombo.ForeColor = vbGreen  End If  If Combo1.ListIndex = 2 Then  lblcombo.ForeColor = vbBlue  End If  End Sub Combo Box Application
  13. 13.  Private Sub Form_Load() Combo1.AddItem "Red" Combo1.AddItem "Green" Combo1.AddItem "Blue" a=0 Do While a < 31 a=a+1 Combo3.AddItem a Loop b = 1900 Do While b < 2012 b=b+1 Combo4.AddItem b LoopConti…
  14. 14.  Combo2.AddItem "Jan" Combo2.AddItem "Feb" Combo2.AddItem "March" Combo2.AddItem "April" Combo2.AddItem "May" Combo2.AddItem "June" Combo2.AddItem "july" Combo2.AddItem "August" Combo2.AddItem "September" Combo2.AddItem "October" Combo2.AddItem "November" Combo2.AddItem "December" End SubConti…
  15. 15. Output
  16. 16.  The Rich Text Box Control allows the user to enter and edit text while also providing more advanced formatting features than the conventional TextBox control. Syntax: RichTextBoxRich Text Box
  17. 17. How to Open Rich Text Box
  18. 18. Form Design
  19. 19.  Private Sub cmdrtbbox_Click() rtb1.Text = "The rich text box support underlines, Bold and Italic text." rtb1.SelStart = rtb1.Find("underlines") rtb1.Span ("underlines") rtb1.SelUnderline = True rtb1.SelStart = 0 rtb1.SelStart = rtb1.Find("Bold") rtb1.Span ("Bold") rtb1.SelBold = TrueConti…
  20. 20.  rtb1.SelStart = 0 rtb1.SelStart = rtb1.Find("Italic") rtb1.Span ("Italic") rtb1.SelItalic = True rtb1.SelStart = 0 rtb1.SelStart = rtb1.Find("underlines") rtb1.Span ("underlines") rtb1.SelFontName = "Arial" rtb1.SelFontSize = 18 End SubConti…
  21. 21. Output
  22. 22.  To Set the value of a point on a graph To select the range of number to be passed into the array To resize a form, field or other graphic objectSlider Control
  23. 23. How to open a slider
  24. 24.  Value Min, Max Tickfrequency Tickstyle Smallchange Largespace Select range Selstart SellengthOperations using Slider
  25. 25.  ccOrientationhorizontal (value 0, the default)  Orients the slider horizontally ccOrientationvertical (value1)  Orients the slider vertically  Slider1.orientation=ccorientationverticalSelecting a Slider’sOrientation
  26. 26.  Slider1.Max=90 Slider1.Min=50Setting a Slider’s Range
  27. 27.  Private Sub Form_Load() Slider1.Max = 250 Slider1.Min = 0 Slider1.LargeChange = 5 Slider1.TickFrequency = 25 End Sub Private Sub Slider1_Change() txt1.Text = "slider position" & Str(Slider1.Value) End SubHandling Slider Events
  28. 28. Conti…
  29. 29.  Private Sub Form_Load() Slider1.Max = 100 Slider1.Min = 0 Slider1.LargeChange = 5 Slider1.TickFrequency = 10 Slider1.TickStyle = sldNoTicks End Sub
  30. 30. THANKS

×