title image


Smiley Re: Dialog zur Auswahl von Farben
Hi,



'Code in ein Modul

Option Explicit

Private Type ChooseColor

lStructSize As Long

hwndOwner As Long

hInstance As Long

lngResult As Long

lpCustColors As Long

flags As Long

lCustData As Long

lpfnHook As Long

lpTemplateName As String

End Type

Private Declare Function ChooseColor Lib "comdlg32.dll" Alias "ChooseColorA" (pChoosecolor As ChooseColor) As Long

Dim CustomColors(0 To 15) As Long

Private Function dlgColor(Optional lngPreColor As Long = 0) As Long

Dim cc As ChooseColor

cc.lStructSize = Len(cc)

cc.lpCustColors = VarPtr(CustomColors(0))

'flags

'cc.flags = 0 'normal

'oder:

cc.flags = 2 'erweitert

If ChooseColor(cc) 0 Then

dlgColor = cc.lngResult

Else

dlgColor = lngPreColor

End If

End Function

Sub Demo()

Dim lngColor As Long

lngColor = dlgColor(4)

MsgBox "Gewählte Farbe: " & lngColor

End Sub



mfg xla

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: