vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Schützen Sie Ihre Software vor Software-Piraterie - mit sevLock 1.0 DLL!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
Re: ComboBox nach links verbreitert aufklappen 
Autor: Rippler
Datum: 29.10.12 11:36

neue Form, Code einfügen, starten

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 Const CB_SETDROPPEDWIDTH = &H160
 
Dim WithEvents Picture1 As PictureBox
Dim WithEvents Combo1 As ComboBox
 
Private Const cboBreite As Long = 6750
Private Const cboLinkerAbstand As Long = 100
Dim cbo_Left As Long
Dim cbo_Pos As Long
 
Private Sub Form_Load()
   Me.Width = 10000
   Me.Height = 5000
   Me.Top = 1000
   Me.Left = 3000
 
   Set Combo1 = Form1.Controls.Add("VB.ComboBox", "Combo1")
   Combo1.Move 2000, 500
   Combo1.Width = 3000
   Combo1.Visible = True
   cbo_Left = Combo1.Left
   cbo_Pos = cbo_Left - cboBreite + Combo1.Width
   If cbo_Pos < cboLinkerAbstand Then cbo_Pos = cboLinkerAbstand
 
   Set Picture1 = Form1.Controls.Add("VB.PictureBox", "Picture1")
   Picture1.Move Combo1.Left + 30, Combo1.Top + 30
   Picture1.Height = 0
   Picture1.Width = 0
   Picture1.Visible = False
 
   Dim x As Integer
   For x = 0 To 9
      Combo1.AddItem "Test_" & x
   Next x
 
   SendMessage Combo1.hwnd, CB_SETDROPPEDWIDTH, _
      (cboBreite / Screen.TwipsPerPixelX), 0&
End Sub
 
Private Sub Picture1_Paint()
   Picture1.Visible = False
   Combo1.Left = cbo_Left
End Sub
 
Private Sub Combo1_DropDown()
   Combo1.Left = cbo_Pos
   Picture1.Visible = True
End Sub
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
ComboBox nach links verbreitert aufklappen1.941icolor26.10.12 09:35
Re: ComboBox nach links verbreitert aufklappen1.269mst54726.10.12 13:26
Re: ComboBox nach links verbreitert aufklappen1.142icolor26.10.12 13:50
Re: ComboBox nach links verbreitert aufklappen1.233mst54726.10.12 15:23
Re: ComboBox nach links verbreitert aufklappen1.134icolor29.10.12 07:43
Re: ComboBox nach links verbreitert aufklappen1.127icolor29.10.12 07:50
Re: ComboBox nach links verbreitert aufklappen1.172Rippler29.10.12 11:36
Re: ComboBox nach links verbreitert aufklappen1.158icolor29.10.12 15:40

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel