Re: Bit surprised there aren't more virtual listbox controls/code

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Thu, 28 Feb 2008 21:01:41 -0600, "Larry Serflaten"
<serflaten@xxxxxxxxxxxxxx> wrote:


"MM" <kylix_is@xxxxxxxxxxx> wrote

By the way, I don't need Sort. This particular app is just a long bog
roll of MIDI events going from 0 through nnnn.

What about using a simple Textbox?

The code below shows a list of 75,000 events. Add a textbox to the
form and set MultiLine (True) and ScrollBars (Vertical).

HTH
LFS


Option Explicit
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long


Private Sub Form_Load()
Dim data As String
Dim e As Long
Text1.Font.Name = "Courier New"
Text1.Font.Size = 10
Text1.Move 0, 0, 5000, 3000

data = Space$(2700000)
Mid(data, 1) = "- - <data for event 000000> - -" & vbCrLf
Mid(data, 37) = data
For e = 1 To 75000
Mid(data, e * 36 - 14) = Right$("000000" & CStr(e), 6)
Next
SendMessage Text1.hwnd, 12&, 0&, ByVal data
End Sub

Doesn't work on 98SE. The textbox remains blank. I tried interposing
Text1.Text = data before the SendMessage, then steeping over
SendMessage, but it raised an Out of Memory error, even when I cut
down the size of the data considerably.

MM
.



Relevant Pages

  • Re: Bit surprised there arent more virtual listbox controls/code
    ... roll of MIDI events going from 0 through nnnn. ... What about using a simple Textbox? ... Private Declare Function SendMessage Lib "user32" _ ... Dim data As String ...
    (microsoft.public.vb.general.discussion)
  • Re: TextBox Anzahl Zeilen nach wordwrap abfragen
    ... lparam as any) auch in vb.net deklarieren. ... Gibt diese Funktion die Anzahl ... Zeilen in der TextBox zurück? ... Auch der Aufruf von SendMessage macht in vb.net Probleme, ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: Löschen mit SendMessage
    ... Welcher Befehl wird nicht an die Textbox weitergeleitet? ... Der Klick auf einen Menüeintrag nicht. ... Wenn Du mit SendMessage etwas an eine Textbox senden ... musst Du dazu deren hWnd mit übergeben. ...
    (microsoft.public.de.vb)
  • Why doesnt this work ?
    ... I have a UserForm with a TextBox and a CommandButton. ... I want to write some text on the TexBox using the 'SendMessage' API when the ... SendMessage Hndle, WM_SETTEXT, 0, ByVal "WOW!" ...
    (microsoft.public.excel.programming)