KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

MessageBoxes - setting default button?

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Sat Feb 17, 2007 1:22 pm    Post subject: MessageBoxes - setting default button? Reply with quote

So I've guessed my way through creating a messagebox hehe...

Questions are;

Is the below way the most "dotnetty" way of creating a messagebox?

Is there a way to set the default selection?

Code:

$nul = $System.Application.EnableVisualStyles

$Form1 = $System.Form()
$Form1.FormBorderStyle = 1  ;FormBorderStyle_FixedSingle
$Form1.Left = 0
$Form1.StartPosition = 0  ;FormStartPosition_Manual
$Form1.Size = $System.Size(396,275) ;(Width,Height)
$Form1.Text = "MessageBox test"
$Form1.Top = 0

$Button1 = $System.Button()
$Button1.Left = 155
$Button1.Text = "Button1"
$Button1.Top = 105
$Button1.Click = "MsgBoxResult()"
$nul = $Form1.Controls.Add($Button1)

$Form1.Show  ;Displays the Form

FUNCTION MsgBoxResult()
     $MsgBoxResult = MsgBox()
     IF $MsgBoxResult = $System.DialogResult_Yes
          ? "Yes"
     ENDIF
ENDFUNCTION

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0

FUNCTION MsgBox()
     $MsgBoxMessage = "test message"
     $MsgBoxTitle = "test title"
     $MsgBoxButtons = $System.MessageBoxButtons_YesNo
     $MsgBoxIcon = $System.MessageBoxIcon_Warning
     
     $MsgBox = $System.MessageBox.Show($MsgBoxMessage, $MsgBoxTitle, $MsgBoxButtons, $MsgBoxIcon)
ENDFUNCTION


Last edited by masken on Sat Feb 17, 2007 1:34 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Sat Feb 17, 2007 1:33 pm    Post subject: Reply with quote

Well done m8
_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group