ColourDialog
SelectColour = ColourDialog([CustomColour])
 
Parameters:

    [CustomColour] = Optional custom colour
Returns:

    SelectColour= The colour the user selected/created
 

     ColourDialog opens a windows colour selection dialog. The dialog allows the user to pick and create a palette of 16 custom colours in RGB format. You can set and read the colour dialogs internal palette using the SetColourDialogColour() and GetColourDialogColour() functions.




FACTS:


      * The ColourDialog returns a -1 value when the user selects cancel.

      * The ColourDialog returns colours in RGB format (24bit).

      * ColourDialog is not asynchronous, so the PlayBasic application will halt while the dialog is open.




 
Example Source: Download This Example
; Include the Dialogs library in this program
  #Include "PBDialogs"
  
  
; Init the Colour Palette of the Colour Dialog
  For lp=0 To 16
     SetColourDialogColour(lp,RndRGB())
  Next
  
; Open the Colour Selection Dialog
  ThisColour=ColourDialog(RGB(255,255,255))
  
  If ThisColour<>-1
     
   ; Display message
     CenterText 400,180,"Here's your colour"
     BoxC 300,200,500,400,true,ThisColour
     
  Else
     CenterText 400,180,"You Pressed Cancel"
     
  EndIf
  
  
  // Display the screen & wait for a key press to end
  Sync
  WaitKey
  
  
  
  
  
  
 
Related Info: FolderDialog | LoadDialog | SaveDialog :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com