Click here to Skip to main content
15,897,518 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: hello Pin
Christian Graus26-Dec-08 12:12
protectorChristian Graus26-Dec-08 12:12 
QuestionFirst Question - Problem repainting datagridview Pin
snakeyes200226-Dec-08 5:40
snakeyes200226-Dec-08 5:40 
AnswerRe: First Question - Problem repainting datagridview Pin
Mycroft Holmes28-Dec-08 16:29
professionalMycroft Holmes28-Dec-08 16:29 
QuestionPDF file to Crystal Reports converter Pin
jigneshDPatel26-Dec-08 1:30
jigneshDPatel26-Dec-08 1:30 
AnswerRe: PDF file to Crystal Reports converter Pin
Dave Kreskowiak26-Dec-08 7:04
mveDave Kreskowiak26-Dec-08 7:04 
GeneralRe: PDF file to Crystal Reports converter Pin
jigneshDPatel26-Dec-08 16:38
jigneshDPatel26-Dec-08 16:38 
GeneralRe: PDF file to Crystal Reports converter Pin
Dave Kreskowiak26-Dec-08 17:27
mveDave Kreskowiak26-Dec-08 17:27 
QuestionMultiline listview Pin
JR21226-Dec-08 0:40
JR21226-Dec-08 0:40 
Hi,
How can I create a multiline listview in VB.net(2008)
I converted some code already:
Public Class MultiLineListview
    Inherits System.Windows.Forms.ListView
    Dim _Font As Font = MyBase.Font
    Sub New()
      Me.OwnerDraw = True
      Me.View = Windows.Forms.View.Details
      Me.FullRowSelect = True
      Me.HoverSelection = False
    End Sub

    Protected Overrides Sub OnDrawColumnHeader(ByVal e As System.Windows.Forms.DrawListViewColumnHeaderEventArgs)
      e.DrawDefault = True
      MyBase.OnDrawColumnHeader(e)
    End Sub
    Protected Overrides Sub OnDrawSubItem(ByVal e As System.Windows.Forms.DrawListViewSubItemEventArgs)
      On Error Resume Next

      If e.ItemIndex > -1 And e.ItemIndex < Me.Items.Count Then
        Dim sText As String = e.SubItem.Text
        Dim sLines() As String = Split(sText, vbCrLf)
        If InStr(1, e.ItemState.ToString.ToLower, "selected") > 0 Then
          e.Graphics.FillRectangle(SystemBrushes.Highlight, e.Bounds)
        Else
          e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds)
        End If
        e.Graphics.DrawRectangle(SystemPens.Control, e.Bounds)
        e.Graphics.DrawString(sText, Me.Font, SystemBrushes.WindowText, e.Bounds.Left, e.Bounds.Top)
      End If
      MyBase.OnDrawSubItem(e)
    End Sub


    Protected Overrides Sub OnCreateControl()
      On Error Resume Next
      Me.Items.Clear()
    End Sub
  End Class


However I can't change the height of each row
For a listbox this code works fine
Protected Overrides Sub OnMeasureItem(ByVal e As System.Windows.Forms.MeasureItemEventArgs)
      On Error Resume Next
      If e.Index > -1 And e.Index < Me.Items.Count Then
        Dim sSize As SizeF

        Dim sText As String = Me.Items(e.Index).ToString()
        'Dim sLines() As String = Split(sText, vbCrLf)

        sSize = e.Graphics.MeasureString(sText, Me.Font)
        e.ItemHeight = sSize.Height '* (sLines.GetUpperBound(0))
      End If
      MyBase.OnMeasureItem(e)
    End Sub

But It won't work for a listview
AnswerRe: Multiline listview Pin
Dave Kreskowiak29-Dec-08 4:38
mveDave Kreskowiak29-Dec-08 4:38 
GeneralRe: Multiline listview Pin
JR2124-Jan-09 23:21
JR2124-Jan-09 23:21 
GeneralRe: Multiline listview Pin
Dave Kreskowiak5-Jan-09 1:18
mveDave Kreskowiak5-Jan-09 1:18 
GeneralRe: Multiline listview Pin
JR2125-Jan-09 1:29
JR2125-Jan-09 1:29 
AnswerRe: Multiline listview Pin
derekbeacroft17-Jun-13 7:20
derekbeacroft17-Jun-13 7:20 
GeneralRe: Multiline listview Pin
JR21218-Jun-13 4:49
JR21218-Jun-13 4:49 
QuestionHow can refresh DB ??? Pin
JC.KaNNaN25-Dec-08 21:48
JC.KaNNaN25-Dec-08 21:48 
AnswerRe: How can refresh DB ??? Pin
Dave Kreskowiak26-Dec-08 7:00
mveDave Kreskowiak26-Dec-08 7:00 
AnswerRe: How can refresh DB ??? Pin
Nanda_MR26-Dec-08 18:13
Nanda_MR26-Dec-08 18:13 
QuestionMigration issue from VB6 to VB.Net Pin
Sree Nivas25-Dec-08 19:20
Sree Nivas25-Dec-08 19:20 
AnswerRe: Migration issue from VB6 to VB.Net Pin
Dave Kreskowiak26-Dec-08 6:59
mveDave Kreskowiak26-Dec-08 6:59 
GeneralRe: Migration issue from VB6 to VB.Net [modified] Pin
Sree Nivas26-Dec-08 20:17
Sree Nivas26-Dec-08 20:17 
GeneralRe: Migration issue from VB6 to VB.Net Pin
Dave Kreskowiak27-Dec-08 5:49
mveDave Kreskowiak27-Dec-08 5:49 
QuestionCreate a folder with full Sharing Rights Pin
pdnet25-Dec-08 18:16
pdnet25-Dec-08 18:16 
AnswerRe: Create a folder with full Sharing Rights Pin
Khanna Gaurav26-Dec-08 3:40
Khanna Gaurav26-Dec-08 3:40 
AnswerRe: Create a folder with full Sharing Rights Pin
Dave Kreskowiak26-Dec-08 6:53
mveDave Kreskowiak26-Dec-08 6:53 
NewsGIDS 2009 .Net:: Save Big, Win Big, Learn Big: Act Before Dec 29 2008 Pin
Shaguf Mohtisham25-Dec-08 17:39
Shaguf Mohtisham25-Dec-08 17:39 

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.