Gambas/Dialogue

From Wikibooks, open books for an open world
< Gambas
Jump to: navigation, search

back to Gambas

Standard Dialogs[edit]

They make your coding easier.

In the following example you will use standard dialogues choosing Standarddialoge für die Wahl

  • the font
  • the colour
  • the file name
  • the file path

You need 1 textarea and 3 commandbuttons, to get the program going.

PUBLIC SUB Button1_Click()
 IF Dialog.SelectFont() THEN RETURN
 Textarea1.Font = Dialog.Font
END
PUBLIC SUB Button2_Click()
 IF Dialog.SelectColor() THEN RETURN
 Textarea1.BackColor = Dialog.Color
END
PUBLIC SUB Button3_Click()
Dialog.SaveFile() 
File.Save(Dialog.Path, TextArea1.Text)
CATCH 
IF ERROR THEN RETURN
END


Theory[edit]

Properties[edit]

Color  Filter  Font  Path  Title  

Methods[edit]

OpenFile  SaveFile  SelectColor  SelectDirectory  SelectFont