DivaneTR Posted May 8, 2012 Share Posted May 8, 2012 [center][color=teal][size=16pt][font=trebuchet ms]Bu konuda sizlere AMS programlarımız için çıkış buttonu nasıl tasarlanır onu göstereceğim. Bir button oluşturalım ve kodlarımızı yazalım.[/font][/size][/color][/center] [code] Sor = Dialog.Message("ExtremitySoft", "Programı Kapatmak İstediğinizden\nEmin Misiniz ?", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); if Sor == IDOK then os.exit() end [/code] [center][color=teal][size=16pt][font=trebuchet ms]Önizleme ;[/font][/size][/color][/center] [center][img]http://i.imgur.com/0kzRC.png[/img][/center] [center][color=teal][size=16pt][font=trebuchet ms]Bu işlemi button olmadan direkt olarak windows penceresindeki kapat buttonu ile ilişkilendirebiliriz. Global Functions kısmına kodlarımızı yazalım ;[/font][/size][/color][/center] [code] function QueryAllowProjectClose() Sor = Dialog.Message("ExtremitySoft", "Programı Kapatmak İstediğinizden\nEmin Misiniz ?", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); if Sor == IDOK then return true else return false end end [/code] [center][color=teal][size=16pt][font=trebuchet ms]Şimdi windows penceresindeki kapat butonunu devredışı bırakalım [/font][/size][/color][/center] [code] function QueryAllowProjectClose() return false end [/code] [center][color=teal][size=16pt][font=trebuchet ms]Çıkış eylemi için os.exit() komutunu kullandım. Pek bilindik birşey değil. Programın neresinde olursa olsun kökten kapatır.[/font][/size][/color][/center] Quote Link to comment Share on other sites More sharing options...
HalilYanar Posted May 11, 2012 Share Posted May 11, 2012 [quote]Sor = Dialog.Message("ExtremitySoft", "Programı Kapatmak İstediğinizden\nEmin Misiniz ?", MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); if Sor == IDOK then os.exit() end[/quote] Oraydaki "os.exit()" Yerine Application.Exit() yazılabilir mi? Quote Link to comment Share on other sites More sharing options...
KintaRo Posted May 11, 2012 Share Posted May 11, 2012 Application.Exit()'i DialogEx gibi yerlerde kullanamazsınız. Ama os.exit() heryerde programı kapatabilir. Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted May 11, 2012 Author Share Posted May 11, 2012 [center][b]KintaRo'nun da dediği gibi os.exit() fonksiyonu programın neresinde olursa olsun programı sonlandırır. Bir nevi TerminateProcess görevi gibi.[/b][/center] Quote Link to comment Share on other sites More sharing options...
abdullahTR Posted May 11, 2012 Share Posted May 11, 2012 bunu niye önceden yapmadın baba benim projeye koyardım artık bi dahaki cd ye ekleriz bunu Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted May 11, 2012 Author Share Posted May 11, 2012 [quote name='abdullahTR' date='11 May 2012 - 13:29 ' timestamp='1336732170' post='1199643'] bunu niye önceden yapmadın baba benim projeye koyardım artık bi dahaki cd ye ekleriz bunu [/quote] [center][size="3"][color="#FF0000"][font="Trebuchet MS"][b]Çok önemli birşey değil bence, ayrıntıdır. Gene de istersen bi titreşim göndermen kafi [/b][/font][/color][/size][/center] Quote Link to comment Share on other sites More sharing options...
abdullahTR Posted May 11, 2012 Share Posted May 11, 2012 göndercem titreşim az kaldı öbür cd ye Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted December 30, 2012 Share Posted December 30, 2012 windows kapat butonunuda(x) engelelyebiliyor muyuz ? Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted December 31, 2012 Author Share Posted December 31, 2012 Evet, penceredeki kapat butonunu iş görmez hale getirebilirsin. Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted December 31, 2012 Share Posted December 31, 2012 Evet, penceredeki kapat butonunu iş görmez hale getirebilirsin. function QueryAllowProjectClose()return falseend bu kodu on show a yazıyorum olmuyor butona yazıyorum olmuyor. Nereye yazacağım allah aşkına :Q Quote Link to comment Share on other sites More sharing options...
DivaneTR Posted December 31, 2012 Author Share Posted December 31, 2012 Global functions'a yazıcaksın ama tek satır halinde değil. Şöyle ; function QueryAllowProjectClose() return false end Quote Link to comment Share on other sites More sharing options...
WolfmanTR_ Posted December 31, 2012 Share Posted December 31, 2012 (edited) Global functions'a yazıcaksın ama tek satır halinde değil. Şöyle ; function QueryAllowProjectClose() return false end C# dan ams ye geçince global i unutmuşum :Q Edited August 18, 2013 by WolfmanTR_ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.