Monday, April 22, 2013

image074

ListView Control VB.Net मे provide किया गया एक important control है। Windows मे list View control का बहुत use किया जाता है। इसे items को List मे display करने के लिए use किया जाता है जिसमे items का text, icons, type etc. information भी display होती है। Windows Explorer मे Display होने वाले folders और files की List इसका एक example है। इसमे कई प्रकार की property होती हैं जो इसके appearance को control करती है जैसे – Small Icon, Large Icon, Report, List etc. My Computer, My Document etc. इसकी example हैं।

Properties: इसमे text को छोडकर सभी common properties use होती है।

  • Name: इसका use Control के name को set और get करने के लिए किया जाता है। जो की program मे control को identify करता है।
  • View: इसका use Listview control मे display होने वाले items के view को set करने के लिए किया जाता है। इसमे निम्न values होती हैं-

LargeIcon

इसे प्रयोग करने पर icons large size मे display होते हैं.

SmallIcon

इसे प्रयोग करने पर icons small size मे display होते हैं.

List

इसमे items list मे display होते हैं और केवल उनका caption display होता है।

Report

इसमे items और उसके sub items display होते हैं।

  • Arrange: इसे item के arrangement के set करने के लिए use किया जाता है।

Default

Item को move करने पर यह उसी drop किए गए place पर रहेगा

Left

यह control के left side मे automatically align हो जाएगा

SnapToGrid

Item automatically invisible grid मे align हो जाएगा drop करने पर

Top

Item Control के top पर align हो जाएगा

  • HeaderStyle: यह property Report View Select करने पर Listview के Header text को सेट करने के लिए use की जाती है। इसकी निम्न value होती हैं –

Clickable

Visible column जहाँ header click करने पर respond करेगा

NonClickable

Visible column header लेकिन click करने पर कोई resond नहीं होता है।

None

No visible column header

  •  Activation: यह property listView के items के activation को define करने के लिए किया जाता है।

OneClick

Items single click करने पर activate हो जाता है। items का color, shape और caption cursor के जाने पर change हो जाता है।

Standard

Items double click करने पर activate होता है। उसके color, shape etc. मे कोई change नहीं होता।

TwoClick

Items double click मे activate होता है। cursor के item के ऊपर होने पर Textcolor, shape etc. change हो जाता है।

  • FullRowSelect: इसके ture होने पर item को select करने पर पूरी row select हो जाती है। यह केवल report view मे work करती है।
  • GridLines: इसके ture होने पर items और उसके subitems के बीच lines draw हो जाती है। यह report view मे work करती है।
  • LabelEdit: इसके ture होने पर user items के text को modify कर सकता है। यह defaultly false होती है।
  • MultiSelect: यह determine करती है की user multiple items को select कर सकता है या नहीं। इसके ture होने पर multiple items को select किया जा सकता है।
  • Scrollable: इसके ture होने पर scrollbar automatically display होता है।
  • Sorting: यह property determine करती है की items को sort होंगे या नहीं। इसके true होने पर items automatically sort हो जाते है।

Methods: इस control मे common methods use होती है। इसमे कई methods होती है जो की इसके collections मे available होती हैं।

image071

image072

Timer Control एक Looping control है जो कि किसी task को एक given time of Interval मे repeat करने के लिए use किया जाता है। यह किसी भी task जो कि इसके Tick event handler मे define किया जाता है उसे इसके interval property मे define किए गए time के अनुसार repeat करता है। यह timer के start () method के call होने पर start हो जाता है। और तब तक work को repeat करता रहता है जब तक Timer को stop नहीं किया जाता है। यह control runtime मे display नहीं होता है। इसकी properties, methodsऔर events निम्न हैं।

Properties: इस control मे सबसे कम properties होती है। जो निम्न हैं।

  • Name: यह control के name को set करने के लिए use की जाती है।

Msgbox (Timer1.Name)

  • Enabled: यह Timer control को enable और disable करने के लिए use कि जाती है। यह defaultly True होती है।

Timer.Enabled = True

  • Interval: इसका use Timer control के repeation interval को get और set करने के लिए use की जाती है। इसी interval के अनुसार ही timer task को repeat करता है।

Timer1.Interval= 2000

Methods: Timer मे निम्न दो methods होती है।

  • Start: इस method का use Timer को Start करने के लिए किया जाता है।

Timer1.Start ()

  • Stop: इसका use Timer को stop करने के लिए किया जाता है।

Timer1.Stop ()

Events:

  • Tick:  यह event Timer के interval property मे set किया गए Time के अनुसार Task को Repeat करने के use किया जाता है। यह Timer की default events है जोTimer के strat() और stop() method के बीच task repeat करती है।

Private Sub Timer1_Tick (ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

End Sub

Program:

image073

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click

Timer1.Start()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click

Timer1.Stop()

End Sub

Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Label1.Text = Val(Label1.Text) + 1

End Sub

End Class

Scroll Bar

image066 image067

image068

Scroll Bar windows मे use होने वाला एक महत्वपूर्ण GUI component है। Scrollbar एक long strip होती है जो की use को किन्ही दो values के बीच selection provide करने के लिए use की जाती हैं। यह मुख्यतः windows मे use होने वाले gui components मे screen मे display न होने वाले components को show करने के लिए use किया जाता है।scrollbar control मे दो end points होते हैं। और इसके बीच एक indicator होता है जो कि दोनों end points के बीच value को select करने के लिए use होता है। Scrollbar control Horizontally और vertically दोनों प्रकार से use किया जाता है। Horizontal Scrollbar के लिए HScrollBar और Vertical Scrollbar के लिए VScrollbar Select किया जाता है। Scrollbar के दोनों ends पर click करने इसकी value धीरे धीरे change होती है जबकि indicator और ends के बीच click करने पर यह जल्दी change होती है।

Properties: इसमे सभी common properties, text को छोडकर available होती हैं। other properties निम्नलिखित हैं।

  • Minimum: इस property का use scroll bar control की minimum value set और get करने के लिए किया जाता है। इसकी default value 0 होती है।
  • Maximum: इस property का use scroll bar control की Maximum value set और get करने के लिए किया जाता है। इसकी default value 100 होती है।
  • SmallChange: इसका use scrollbar के ends पर click करने पर indicate की value मे होने वाले change को set और get करने के लिए किया जाता है।
  • LargeChange: इसका use scrollbar के ends और Indicator के बीच के space पर click करने पर indicate की value मे होने वाले change को set और get करने के लिए किया जाता है।
  • Value: इसका use Indicator कि current position को get या set करने के लिए किया जाता है।
  • Dock: इसका use scrollbar कि position को set करने के लिए किया जाता है जिसकी निम्न वैल्यू होती हैं।– None, Left, Right, Top, Bottom और Fill.

image069

Methods: इसमे सभी common methods available होती हैं।

Events: सभी common events के साथ ही इसमे निम्न events भी होती हैं।

  • Scroll: यह event scrollbar के indicator को scroll करने पर perform होती है।

Private Sub HScrollBar1_Scroll (ByVal sender As Object, ByVal e As System.Windows.Forms.ScrollEventArgs) HandlesHScrollBar1.Scroll

End Sub

  • ValueChanged: यह scrollbar के indicator कि value (Position ) change करने पर perform होती है।

Private Sub HScrollBar1_ValueChanged (ByVal sender As Object, ByVal e As System.EventArgs) Handles HScrollBar1.ValueChanged

End Sub

Example:

image070

Public Class Form5

Private Sub Form5_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Me.HScrollBar1.Maximum = 255

Me.HScrollBar2.Maximum = 255

Me.HScrollBar3.Maximum = 255

End Sub

Private Sub HScrollBar1_Scroll (ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) HandlesHScrollBar1.Scroll, HScrollBar2.Scroll, HScrollBar3.Scroll

Me.BackColor = Color.FromArgb (HScrollBar1.Value, HScrollBar2.Value, HScrollBar3.Value)

End Sub

End Class

Picture Box

image059

image060

Picture Box Windows GUI का एक important हिस्सा है। यह windows मे Images को display करने मे help करता है। Visual Basic.Net मे picture box control पाया जाता है जो की Windows Form मे किसी भी image को display करने के लिए use किया जाता है। इसे BMP, JPEG, JPG, PNG, icons etc. के लिए use किया जाता है। यह कई प्रकार की properties और methods provide करता है जो कि image को set और manipulate करने मे help करती हैं। इसमे निम्न properties, methods और events होती हैं।

Properties: सभी common properties, Text छोड़कर इसमे apply होंगी। other properties निम्न हैं।

  • Image: यह picture box की सबसे important property है। इसका use picture box मे picture को get और set करने के लिए किया जाता है।
  • BorderStyle: यह control के border style को सेट करने के लिए use की जाती है। इसमे तीन values- None, FixedSingle और Fixed3D होती हैं।
  • SizeMode: यह property image को picture box मे arrange करने के लिए use की जाती है। इस property की निम्न values होती हैं।
Normal इस mode मे image normal size मे रहती है अर्थात image की size picture box से अधिक होने पर यह display नहीं होती है। image061
StretchImage इसमे image, picture box के size मेautomatically arrange हो जाती है। image062
Autosize इसमे picture box, image की size केequal size का हो जाता है। image063
CenterImage इसे use करने पर न picture box कीsize change होती है और न ही imageकी। इसमे image का center part picture box मे display होता है। image064
Zoom इसमे image, picture box मे fill हो जाती है। image065

 

Methods: सभी common methods इसमे use होती हैं। साथ ही इसकी कुछmethods निम्न हैं-

  • RotateFlip: इसका use image को rotate करने के लिए किया जाता है। इसे निम्न प्रकार से use किया जाता है।

Syntax- Image.RotateFlip (Type)

Ex- picturebox.Image.RotateFlip (Rotate180FlipNone)

  • Save: इसका use image को save करने के लिए किया जाता है। इसके लिए image के path का use किया जाता है।

Syntax- Image.Save (path)

Ex- PictureBox1.Image.Save (“C:\tmp.bmp)

Events : इसमे सभी common events use की जा सकती हैं।

Sunday, April 21, 2013

Radio Button


Radio button control का use भी checkbox की तरह ही options provide करने के लिए किया जाता है। Radio button checkbox जैसे की selection provide करती है लेकिन इसमे केवल एक group मे केवल एक ही radio button को select किया जा सकता है। यह single selection provide करता है जबकि checkbox multiple selection provideकरता है। Radiobutton मे एक circle display होता है जब किसी RadioButton को select किया जाता है तब उस circle के अंदर एक और filed circle बन जाता है। इसमे जबgroup के किसी दूसरे radiobutton को select किया जाता है तब पहले वाली radiobutton unselect हो जाती है और select की गई button select हो जाती है। RadioButtons काgroup बनाने के लिए container control जैसे – Panel, Group Box etc. का use किया जाता है।
Properties: Checkbox की सभी properties radio button मे भी use होती हैं।
Methods: Checkbox की सभी methods भी radiobutton मे use होती हैं।
Events: CheckBox की सभी events Radio Button मे available होती हैं।



Public Class Form1
Private Sub RadioButton1_CheckedChanged (ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesRadioButton1.CheckedChanged, RadioButton2.CheckedChanged, RadioButton3.CheckedChanged
        If RadioButton1.Checked = True Then
            MsgBox ("High School")
        ElseIf RadioButton2.Checked = True Then
            MsgBox ("Higher Secondary")
        Else
            MsgBox ("Graduate")
        End If
    End Sub
End Class

Tuesday, April 9, 2013




CheckBox control का use user को option select करने के facility provide करने के लिए किया जाता है। यह user को multiple selection provide करता है अर्थात multiple checkbox मे multiple checkbox को एक साथ select किया जा सकता है। checkbox control मे text display होता है और text से पहले एक rectangular button display होती है जिसके सिलैक्ट होने पर एक check का symbol इसमे display होने लगता है और unselect होने पर यह check symbol display नहीं होता है।

Properties: सभी Common properties इस control मे apply होती हैं। साथ ही इसमे कुछ properties निम्न हैं।

·         Checked: इसका use check box को check या uncheck करने के लिए और उसकी वैल्यू को get करने के लिए किया जाता है। इसके ture होने पर checkbox checked होता है और false होने पर यह unchecked होता है।

Methods: सभी common methods इसमे apply होंगी।

Events: सभी common events भी इसमे apply होती हैं। अन्य events निम्न हैं।

·         CheckedChanged: यह checkbox के select या unselect होने पर होती है।




Private Sub CheckBox1_CheckedChanged (ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

End Sub

Public Class Form1
    Private Sub CheckBox1_CheckedChanged (ByVal sender As Object, ByVal e As System.EventArgs) HandlesCheckBox1.CheckedChanged, CheckBox2.CheckedChanged
        If CheckBox1.Checked = True Then
            MsgBox ("Game")
        End If
        If CheckBox2.Checked = True Then
            MsgBox ("Drawing")
        End If
    End Sub
End Class



ComboBox, Listbox और Textbox का combination है जिसका use list को display करने के लिए किया जाता है। यह list को drowdown format मे display करता है। इसमे एकtextbox होता है जिस पर text input कर सकते हैं साथ ही एक arrow button पर click करने पर एक list display होती है जिस पर items को select कर सकते हैं। यह listbox की जगह कम space लेता है। और list को भी display करता है। ComboBox मे केवल एक item को select कर सकते हैं।
Properties: इसमे Listbox की सभी properties apply होती हैं। साथ की इसमे कुछ special property होती हैं जो निम्न हैं।  
·         DrowDownStyle: इसका use combobox की style set करने के लिए किया जाता है। इसकी निम्न value होती हैं।

DrowDown
Default, इसमे combobox मे एक textbox display होता है जिस पर user लिखा सकता है और list से items select भी कर सकता है.

DrowDownList
इसमे user text input नहीं कर सकता है केवल पहले से available items को सिलैक्ट कर सकता है।

Simple       
इसमे textbox और list दोनों display होते है। इसमे list dropdown type नहीं होती है।


Methods: इसमे Listbox की सभी methods apply होती हैं।

Events: इसमे Listbox की सभी events apply होती हैं।

Contact us

Name

Email *

Message *