โพโต้ วิชั่นประจำสัปดาห์คอลัมน์ประจำ  ชุมชนคนไซเบอร์ Tips วิชวลเบสิคโปรแกรมคิดค่าชั่วโมงสำหรับร้านเน็ต โพโต้ลิ้งค์  Other  

โพโต้ วิชั่น
   http://www.thai.net/poto,http://go.to/poto
    วันนี้
   ช่วยกันคลิ้กป้ายโฆษณาด้านล่างนี้ด้วยนะครับ
Click here to visit our sponsor
         
 Visual basic

Columns

Related Topics

ข้อตอนรับสู่การแบ่งปันความรู้เพื่อการพัฒนา ซอฟ์ตแวร์ไทย

Tips เกี่ยวกับ ListBox


Public Sub LB_FillList(Listcontrol As ListBox, ParamArray Items())

'FillList List1, "TiffanyT", "MikeS", "RochesterNY"
Dim i As Variant
With Listcontrol
   For Each i In Items
      .Clear
     .AddItem i
   Next
End With
End Sub

Sub ListToArray(list As Object, Ar$())

Dim i&, listCount&
ReDim Ar(list.listCount - 1)
For i = 0 To list.listCount - 1
      Ar(i) = list.list(i)
Next
End Sub


Sub ToolTipList(oc_list As Object, x As Single, y As Single)

'-----------------
' Call oc_list ListBox
'       x ตำแหน่งในแนวแกน x
'       y ตำแหน่งในแนวแกน y
' eg. ว่างซับโปรแกรมนี้ที่ Movemouse even ของ ListBox
'-----------------------------
Dim YPos As Integer, iOldFontSize As Integer
iOldFontSize = Screen.ActiveForm.Font.size
Screen.ActiveForm.Font.size = oc_list.Font.size
YPos = y \ Screen.ActiveForm.TextHeight("Xyz") + oc_list.TopIndex
Screen.ActiveForm.Font.size = iOldFontSize
If YPos < oc_list.listCount Then
      oc_list.ToolTipText = oc_list.list(YPos)
Else: oc_list.ToolTipText = ""
End If
End Sub




Listbox - Horizontal Scrolling
By: Microsoft

Create a new Standard EXE project in
Visual Basic. Form1 is created by default.

Add a CommandButton and a ListBox to Form1.

declaration section of Form1:

Option Explicit
Private Declare Function SendMessageByNum Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Const LB_SETHORIZONTALEXTENT = &H194
Private Sub Command1_Click()
Dim s As String
Static x As Long
s = InputBox("Please enter any text", "List scroll", "this is a simple scrollbar sample for demonstration purposes")
List1.AddItem s
If x < TextWidth(s & " ") Then
     x = TextWidth(s & " ")
If ScaleMode = vbTwips Then _
     x = x / Screen.TwipsPerPixelX ' if twips change to pixels
     SendMessageByNum List1.hwnd, LB_SETHORIZONTALEXTENT, x, 0
End If
End Sub

    .
     
โพโต้ วิชั่นประจำสัปดาห์คอลัมน์ประจำ  ชุมชนคนไซเบอร์ Tips วิชวลเบสิคโปรแกรมคิดค่าชั่วโมงสำหรับร้านเน็ต โพโต้ลิ้งค์  Other  

เว็บเพจนี้ออกแบบให้เข้ากับกรุณาปรับแต่งดังนี้ครับ
Set Display : 800 x 600 pixels & High Color (16 bits), View Text : Medium, Fontface : MS Sans Serif.

Any comments,Please send to poto72@hotmail.com