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

Visual Basic

 
Questionwhat is eguivalent in c# for CShort in vb...? Pin
tasumisra16-Dec-07 23:36
tasumisra16-Dec-07 23:36 
AnswerRe: what is eguivalent in c# for CShort in vb...? Pin
Ashish Kumar Vyas16-Dec-07 23:58
Ashish Kumar Vyas16-Dec-07 23:58 
GeneralRe: what is eguivalent in c# for CShort in vb...? Pin
CKnig17-Dec-07 2:36
CKnig17-Dec-07 2:36 
AnswerRe: what is eguivalent in c# for CShort in vb...? Pin
Dave Doknjas17-Dec-07 14:30
Dave Doknjas17-Dec-07 14:30 
Generalproblem in importing table into Excel Pin
poonams16-Dec-07 22:59
poonams16-Dec-07 22:59 
GeneralRe: problem in importing table into Excel Pin
Ashish Kumar Vyas16-Dec-07 23:39
Ashish Kumar Vyas16-Dec-07 23:39 
GeneralSplitter control in vb.net2005 Pin
VB 8.016-Dec-07 22:43
VB 8.016-Dec-07 22:43 
Generalimage combo in vb.net Pin
Deepthy.P.M16-Dec-07 22:40
Deepthy.P.M16-Dec-07 22:40 
I want to display color with corresponding color name in combo box.In my program i used for this image list.In that i stored bmp images.But i want to display color name also.How i do that .My code is

Public Class Form1

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
End Class


When i add the following code in combobox1_Drawitem
e.Graphics.DrawString(items(e.Index), Me.Font, Brushes.Black, e.Bounds)

It is not working bcs when i set a color name in items(e.index))it is common to every image.How can i solve this problem. Frown | :(
GeneralRe: image combo in vb.net Pin
John_Adams17-Dec-07 8:07
John_Adams17-Dec-07 8:07 
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 
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 

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.