Page loading

Share your opinion
What do you think about gambaslinux.fr?
 
Interesting
It miss some informations
Excellent website
Results
WIDGETS GAMBAS
GAMBAS 3 SOFTWARES
TUTORIALS
Library
MESSAGEBOX - 5 types of messagebox


5 message box types

 


 


 
msg.jpg
 
Hi,
today we will learn about message boxes.

It's somes boxes who send you alert, question, warning or other to ask you to choose one action.


 

1-  DELETE messagebox

01.jpg
 
This box ask you to delete something with delete icon
 

2-ERROR messagebox

02.jpg

This box ask you something with error Icon
 

3-  INFORMATION messagebox

03.jpg

This box ask you something with information icon
 

4- QUESTION messagebox

04.jpg


This box ask you something with question icon
 

5-WARNING messagebox

05.jpg

This box ask you something with warning icon


In all cases , all boxes work with the same structure.
create one integer variable, and result will be in this variable.
Result is simply position of string chain between ',' symbol.
 

One example : :
 i our Messagebox QUESTION, here source code :


myanswer = Message.Question("Are you sure?", "i don't know", "yes, why?", "no,i'm very sure!")

message.question(position 0, position 1, position 2,position 3)

  position 0 is message
  position 1 is first bouton
  position 2 is second bouton
  position 3 is 3rd bouton

when button is clicked, myanswer wil have position value.

6 - OPTIONAL messagebox

06.jpg



This box require gb.settings component
this box is used when you need to use very often one option in your software.
you can validate checkbox who allo by default.
All data will be stored in setting file.conf.

Here source code of our project :


' Gambas class file


Public Sub bdelete_Click()
Dim myanswer As Integer
myanswer = Message.Delete("Delete it?", "no", "yes", "help me mama, i'm scared")
Select Case myanswer
  Case 1 'if i clic on NO
  
  Case 2 'if i clic on YES
  
  Case 3 ' if i clic on HELP ME...
    
End Select
End



Public Sub Form_Open()
Me.Center()
End

Public Sub berror_Click()
Dim myanswer As Integer
Message.Error("An error is occured in module 654F64, do you want to restart windows?", "i can't", "impossible to reboot", "i'm crying")
Select Case myanswer
  Case 1 'if i clic on I CAN'T
  
  Case 2 'if i clic on IMPOSSIBLE...
  
  Case 3 ' if i clic on IM CRYING...
    
End Select
End



Public Sub binfo_Click()
Dim myanswer As Integer
myanswer = Message.Info("Info : ssky is blue", "Sure")
If myanswer = 1 Then Print "clic on sure"
End

Public Sub boption_Click()
Dim myanswer As Integer
Message.Optional("Do you want to do this action every minute", "Why not", "TOTO/TITI", "icon:/32/add", True)
If myanswer = 1 Then Print "clic on WHY NOT"
End

Public Sub bquestion_Click()
Dim myanswer As Integer
myanswer = Message.Question("Are you sure?", "i don't know", "yes, why?", "no,i'm very sure!")
Select Case myanswer
  Case 1 'if i clic on I DON'T KNOW
  
  Case 2 'if i clic on YES...
  
  Case 3 ' if i clic on NO,...
    
End Select
End

Public Sub bwarning_Click()
Dim myanswer As Integer
myanswer = Message.Warning("Warning, your hand is in my...", "excuse me", "was it your..?", "it's not me")
Select Case myanswer
  Case 1 'if i clic on EXCUSE ME
  
  Case 2 'if i clic on WAS IT..
  
  Case 3 ' if i clic on ITS NOT...
    
End Select
End

Public Sub bclose_Click()
Me.Close()
End


You can download source code of this  example HERE
(If file doesn't open , rename file in  exemple.tar.gz, thanks)
 
Thanks for your attention
 
 

Creation date : 14/02/2022 @ 09:12
Last update : 15/02/2022 @ 08:38
Category : MESSAGEBOX
Page read 1682 times


Print the article Print the article


react.gifReactions to this article

Nobody gave a comment yet.
Be the first one to do it!


QUICK MENU
SEARCH




LANGUAGE
COMPONENTS
Other
LANGUAGE
Where, who?
VISITS

   visitors

   visitors online

ARCHIVES GAMBAS 1/2
^ Top ^