Click here to Skip to main content
15,898,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralXML Comments Pin
danasegaranea16-Dec-07 21:43
danasegaranea16-Dec-07 21:43 
GeneralRe: XML Comments Pin
CKnig16-Dec-07 21:46
CKnig16-Dec-07 21:46 
GeneralRe: XML Comments Pin
danasegaranea16-Dec-07 21:52
danasegaranea16-Dec-07 21:52 
GeneralRe: XML Comments Pin
CKnig16-Dec-07 22:21
CKnig16-Dec-07 22:21 
GeneralRe: XML Comments Pin
danasegaranea16-Dec-07 22:35
danasegaranea16-Dec-07 22:35 
GeneralRe: XML Comments Pin
CKnig16-Dec-07 23:00
CKnig16-Dec-07 23:00 
GeneralRe: XML Comments Pin
Kevin McFarlane17-Dec-07 6:10
Kevin McFarlane17-Dec-07 6:10 
GeneralImage ComboBox Control in VB.NET Pin
Deepthy.P.M16-Dec-07 21:30
Deepthy.P.M16-Dec-07 21:30 
I want to display color image with corresponding color name in combo box.I got to display color in combobox not corresponding color name.
The code is

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim items(Me.ImageList1.Images.Count - 1) As String
For i As Int32 = 0 To Me.ImageList1.Images.Count - 1
items(i) = "Item " & i.ToString
Next

Me.ComboBox1.Items.AddRange(items)
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Me.ComboBox1.DrawMode = DrawMode.OwnerDrawVariable
Me.ComboBox1.ItemHeight = Me.ImageList1.ImageSize.Height
Me.ComboBox1.Width = Me.ImageList1.ImageSize.Width + 18
Me.ComboBox1.MaxDropDownItems = Me.ImageList1.Images.Count
End Sub
Private Sub ComboBox1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ComboBox1.DrawItem
If e.Index <> -1 Then
e.Graphics.DrawImage(Me.ImageList1.Images(e.Index), e.Bounds.Left, e.Bounds.Top)
End If
End Sub
Private Sub ComboBox1_MeasureItem(ByVal sender As Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles ComboBox1.MeasureItem
e.ItemHeight = Me.ImageList1.ImageSize.Height
e.ItemWidth = Me.ImageList1.ImageSize.Width
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case (ComboBox1.SelectedIndex)
Case 0
TextBox1.ForeColor = Color.Red
Exit Select
Case 1
TextBox1.ForeColor = Color.Yellow
Exit Select
End Select
End Sub


Frown | :( How i display corresponding color name in that combo box.
GeneralRe: Image ComboBox Control in VB.NET Pin
CKnig16-Dec-07 21:42
CKnig16-Dec-07 21:42 
GeneralRe: Image ComboBox Control in VB.NET Pin
Deepthy.P.M16-Dec-07 22:12
Deepthy.P.M16-Dec-07 22:12 
GeneralRe: Image ComboBox Control in VB.NET Pin
CKnig16-Dec-07 22:20
CKnig16-Dec-07 22:20 
QuestionHow to encrypt a string using rijndael algorithm Pin
Nagaraj.k16-Dec-07 21:11
Nagaraj.k16-Dec-07 21:11 
GeneralRe: How to encrypt a string using rijndael algorithm Pin
CKnig16-Dec-07 21:35
CKnig16-Dec-07 21:35 
QuestionRe: How to encrypt a string using rijndael algorithm Pin
Nagaraj.k17-Dec-07 1:22
Nagaraj.k17-Dec-07 1:22 
GeneralRe: How to encrypt a string using rijndael algorithm Pin
~V~16-Dec-07 22:56
~V~16-Dec-07 22:56 
GeneralUrgent: how to convert string into date in vb.net Pin
Ashish Kumar Vyas16-Dec-07 20:20
Ashish Kumar Vyas16-Dec-07 20:20 
GeneralRe: Urgent: how to convert string into date in vb.net Pin
Georg Kohler16-Dec-07 21:03
Georg Kohler16-Dec-07 21:03 
GeneralRe: Urgent: how to convert string into date in vb.net Pin
CKnig16-Dec-07 21:45
CKnig16-Dec-07 21:45 
GeneralRe: Urgent: how to convert string into date in vb.net Pin
VB 8.016-Dec-07 22:50
VB 8.016-Dec-07 22:50 
GeneralRe: Urgent: how to convert string into date in vb.net Pin
~V~16-Dec-07 22:50
~V~16-Dec-07 22:50 
Questionthe meaning of VB.Command()...? Pin
tasumisra16-Dec-07 19:49
tasumisra16-Dec-07 19:49 
AnswerRe: the meaning of VB.Command()...? Pin
Dave Kreskowiak17-Dec-07 3:45
mveDave Kreskowiak17-Dec-07 3:45 
GeneralCombobox and F4 Pin
SiXke16-Dec-07 5:55
SiXke16-Dec-07 5:55 
Generalerror in vb.net Pin
break_day15-Dec-07 23:02
break_day15-Dec-07 23:02 
GeneralRe: error in vb.net Pin
Bassam Saoud16-Dec-07 1:53
Bassam Saoud16-Dec-07 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.