Click here to Skip to main content
15,916,600 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: text box value to double Pin
dyerstein23-Feb-05 7:46
dyerstein23-Feb-05 7:46 
GeneralRe: text box value to double Pin
Jim Matthews23-Feb-05 9:14
Jim Matthews23-Feb-05 9:14 
GeneralRe: text box value to double Pin
dyerstein23-Feb-05 9:45
dyerstein23-Feb-05 9:45 
GeneralRe: text box value to double Pin
Christian Graus23-Feb-05 9:39
protectorChristian Graus23-Feb-05 9:39 
Generalvb.net and sql 2000 Pin
Member 107391923-Feb-05 6:16
Member 107391923-Feb-05 6:16 
GeneralRe: vb.net and sql 2000 Pin
Colin Angus Mackay24-Feb-05 0:24
Colin Angus Mackay24-Feb-05 0:24 
GeneralRe: vb.net and sql 2000 Pin
Member 107391924-Feb-05 8:32
Member 107391924-Feb-05 8:32 
Generalowner drawn combo box focus rectangle Pin
Anonymous23-Feb-05 6:06
Anonymous23-Feb-05 6:06 
I have a very simple ownder drawn combo box in my windows form application. All i'm doing different is making the first items headers with bold and underlined font. I got everything to work great, except for the focus rectangle. at the end of my code i have the e.drawFocusRectangle() method.. it will select the items, but the item font stays black when selected. if you'll notice on a normal combo box (not owner drawn), the items turn white when selected. Can anyone tell me how to do this? Thanks!

p.s. here's my code for the combobox

    Private Sub initializeComboBox()<br />
<br />
        Me.ComboBox3 = New ComboBox<br />
        Me.ComboBox3.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed<br />
        Me.ComboBox3.Location = New System.Drawing.Point(10, 20)<br />
        Me.ComboBox3.Name = "ComboBox3"<br />
        Me.ComboBox3.Size = New System.Drawing.Size(136, 21)<br />
        Me.ComboBox3.DropDownWidth = 250<br />
        Me.ComboBox3.TabIndex = 0<br />
        Me.ComboBox3.DropDownStyle = ComboBoxStyle.DropDown<br />
        Me.ComboBox3.Location = New System.Drawing.Point(120, 112)<br />
        Me.ComboBox3.Text = "Select Control"<br />
        selectControls = New String() {"Serial       Status", "10303       test", "bloop!"}<br />
        ComboBox3.DataSource = selectControls<br />
        Me.Controls.Add(Me.ComboBox3)<br />
    End Sub<br />
<br />
    Protected Sub ComboBox3_DrawItem(ByVal sender As Object, _<br />
        ByVal e As System.Windows.Forms.DrawItemEventArgs) _<br />
        Handles ComboBox3.DrawItem<br />
<br />
        Dim size As Single<br />
        Dim myFont As System.Drawing.Font<br />
        Dim family As FontFamily<br />
<br />
        Dim itemColor As New System.Drawing.Color<br />
        Select Case e.Index<br />
            Case 0<br />
                size = 8.25<br />
                itemColor = System.Drawing.Color.White<br />
                family = FontFamily.GenericSansSerif<br />
                myFont = New Font(family, size, FontStyle.Bold)<br />
<br />
            Case 1<br />
                size = 8.25<br />
                itemColor = System.Drawing.Color.White<br />
                family = FontFamily.GenericSansSerif<br />
                myFont = New Font(family, size, FontStyle.Regular)<br />
            Case 2<br />
                size = 8.25<br />
                itemColor = System.Drawing.Color.Blue<br />
                family = FontFamily.GenericSansSerif<br />
                myFont = New Font(family, size, FontStyle.Regular)<br />
        End Select<br />
<br />
        e.DrawBackground()<br />
<br />
<br />
        e.Graphics.DrawString(selectControls(e.Index), myFont, System.Drawing.Brushes.Black, _<br />
        New System.Drawing.PointF(2, e.Bounds.Top))<br />
<br />
<br />
        e.DrawFocusRectangle()<br />
    End Sub

QuestionUSB Card Reader. How to read data from usb into string? Pin
Member 116828123-Feb-05 5:02
Member 116828123-Feb-05 5:02 
AnswerRe: USB Card Reader. How to read data from usb into string? Pin
Dave Kreskowiak23-Feb-05 6:33
mveDave Kreskowiak23-Feb-05 6:33 
GeneralTreeview Help Pin
RoedRunner23-Feb-05 3:56
RoedRunner23-Feb-05 3:56 
GeneralRe: Treeview Help Pin
Dave Kreskowiak23-Feb-05 4:49
mveDave Kreskowiak23-Feb-05 4:49 
GeneralRe: Treeview Help Pin
RoedRunner23-Feb-05 4:53
RoedRunner23-Feb-05 4:53 
GeneralRe: Treeview Help Pin
RoedRunner23-Feb-05 5:25
RoedRunner23-Feb-05 5:25 
GeneralRe: Treeview Help Pin
Dave Kreskowiak23-Feb-05 5:47
mveDave Kreskowiak23-Feb-05 5:47 
GeneralRe: Treeview Help Pin
RoedRunner23-Feb-05 7:20
RoedRunner23-Feb-05 7:20 
GeneralCustom ComboBox Problem Pin
Jason Stamp23-Feb-05 3:56
Jason Stamp23-Feb-05 3:56 
GeneralRe: Custom ComboBox Problem Pin
j45mw12-Mar-05 17:39
j45mw12-Mar-05 17:39 
GeneralDatagrind i win applications Pin
Member 31636123-Feb-05 2:33
Member 31636123-Feb-05 2:33 
GeneralRe: Datagrind i win applications Pin
Jim Matthews23-Feb-05 3:36
Jim Matthews23-Feb-05 3:36 
QuestionHow to print a grid Pin
pdcoope23-Feb-05 2:21
pdcoope23-Feb-05 2:21 
AnswerRe: How to print a grid Pin
Dave Kreskowiak23-Feb-05 4:18
mveDave Kreskowiak23-Feb-05 4:18 
GeneralRe: How to print a grid Pin
Anonymous23-Feb-05 7:05
Anonymous23-Feb-05 7:05 
AnswerRe: How to print a grid Pin
Just Greeky Creek23-Feb-05 4:35
Just Greeky Creek23-Feb-05 4:35 
GeneralRe: How to print a grid Pin
Anonymous23-Feb-05 7:06
Anonymous23-Feb-05 7:06 

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.