lamont Posted March 20, 2015 Share Posted March 20, 2015 arkadaşalr open dialog compenentinde mesala bir object seçmedim direk iptal dedigimde hata alıyorum if şartı koştum ama hata yine çözülmedi sorun nedir Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 20, 2015 Editor Share Posted March 20, 2015 string fName = String.Empty; fName = opendialog.filename; FileReadAllText((fName != "") ? fName : ""); Bu şekilde dene Quote Link to comment Share on other sites More sharing options...
KintaRo Posted March 20, 2015 Share Posted March 20, 2015 DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) // Test result. { // kodlar } Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 20, 2015 Editor Share Posted March 20, 2015 DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) // Test result. { // kodlar } Yani kintaronun örneği daha doğru o aklıma gelmedi şimdi. Quote Link to comment Share on other sites More sharing options...
lamont Posted March 20, 2015 Author Share Posted March 20, 2015 oldu illa degişkene atamalıyız :) Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 20, 2015 Editor Share Posted March 20, 2015 illa değişkene atamak zorunda değilsinki. (openFileDialog1.ShowDialog() == DialogResult.OK) ? openFileDialog1.FileName : "" şeklindede kullanabilrisin. Quote Link to comment Share on other sites More sharing options...
lamont Posted March 20, 2015 Author Share Posted March 20, 2015 illa değişkene atamak zorunda değilsinki. (openFileDialog1.ShowDialog() == DialogResult.OK) ? openFileDialog1.FileName : "" şeklindede kullanabilrisin. Pairs DialogResult.OK bir degişken degilmi ? Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 20, 2015 Editor Share Posted March 20, 2015 Constant dır. Quote Link to comment Share on other sites More sharing options...
akkayaonur Posted March 20, 2015 Share Posted March 20, 2015 @lamont @pairs Aslında,DialogResult.OK bir constant değil enumdur. Constantlar const anahtar kelimesi ile tanımlanır ve değişken gibi davranırlar. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted March 21, 2015 Share Posted March 21, 2015 mouse'u üstüne getirince gösteriyor zaten: Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted March 21, 2015 Editor Share Posted March 21, 2015 @lamont @pairs Aslında,DialogResult.OK bir constant değil enumdur. Constantlar const anahtar kelimesi ile tanımlanır ve değişken gibi davranırlar. Enum olduğunu bende biliyorum. enum DialogResult { OK = 1, CANCEL = 2, }; gibi kullanılır işte. Ama aslında oda bir sabittir neticede. Quote Link to comment Share on other sites More sharing options...
lamont Posted March 21, 2015 Author Share Posted March 21, 2015 Kısacası Constantlar gruplandırmaya yarıyor Enumlar diyelim konu kapansın :) 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.