ron rosenfeld - HWzone פורומים
עבור לתוכן
  • צור חשבון

ron rosenfeld

משתמש רשום
  • מספר הודעות

    9
  • הצטרפות

  • ביקר לאחרונה

מבקרים אחרונים

349 צפיות בפרופיל

הדירוגים של ron rosenfeld

Zone Newbie

Zone Newbie (1/6)

0

דירוג

  1. היי אני משתמש בwindows forms של visual studio בניתי תוכנה קטנה עם כפתורים ומה שצריך , אין באגים. עכשיו אני רוצה שהפרוייקט יפעל בתור תוכנה עצמאית. איך עושים את זה???
  2. פתחתי form1 בו יש כפתור "sell" תווית labl_total_money בו מופיע סכום כסף שעולה כל פעם שלוחצים על הכפתור את הסכום הגדרתי כint totalmoney ;lbl_total_money.text=("$"+totalmoney) וכפתור שמעביר לform2 ובנוסף עוד כמה כפתורים ותיבות טקסט שלא רלוונטיים לשאלה. אני רוצה שהפרמטר totalmoney יהיה משותף לשני הטפסים כך שה;lbl_total_money.text=("$"+totalmoney) של form1 יהיה ששווה ל;lbl_total_money.text=("$"+totalmoney) של form2 (אמרו לי sql ואמרו לי אובייקט גלובלי, ניסיתי את שניהם לא עבד)
  3. אוקיי הבנתי לא צריך sql אבל איך עושים פרמטר משותף או אובייקט גלובלי
  4. אני לומד תכנות באופן עצמאי, הצלחתי לעשות שיהיה לי שני forms עשיתי כפתור שמעביר לform השני ואחד שמחזיר לראשון. בform1 הגדרתי int totalmoney שכל פעם שלוחצים על כפתור "sell" הסכום גדל וזה מופיע בlabl השאלה היא איך אני מכניס את הערך של הtotalmoney לforms2 צריך להשתמש בsql? יש דרך אחרת?? אשמח לעזרה
  5. int incom = 5; int lose = 10; int totalmoney = 20; int appels = 6; int buyappels = 4; int sellappels = 2; int score=0; int applebonus=5; private void btn_buy_Click(object sender, EventArgs e) { totalmoney = totalmoney - lose; lbl_total_money.Text = totalmoney + "$"; appels = appels + buyappels; lbl_appels.Text = appels + "appels"; if (totalmoney < lose) { btn_buy.Enabled = false; } else { if (totalmoney >= lose) { btn_buy.Enabled = true; } } } private void btn_sell_Click(object sender, EventArgs e) { totalmoney = totalmoney + incom; lbl_total_money.Text = totalmoney + "$"; appels = appels - sellappels; lbl_appels.Text = appels + "appels"; if (appels < buyappels) { btn_sell.Enabled = false; } else { if (appels >= buyappels) { btn_sell.Enabled = true; } } תודה על העזרה מקודם מסתבר שבהתחלה הייתי בכיוון ואיכשהו משהו התפקשש לי , אבל עכשיו אני רוצה לדעת איך אני מפעיל מחדש כפתור אחרי שאני משבית אותו עשיתי btn_sell.enabled=true אבל כאשר אני מגיע למצב כזה: appels>=buyappels הכפתור עדיין מושבת
  6. int incom=5; int lose=10; int startmoney = 20; int totalmoney ; int newtotalmoney; זאת הדרך המקורית : שאני לוחץ buy פעם ראשונה זה מוריד 10 מסכום: totalmoney = startmoney - lose; lbl_total_money.Text = totalmoney + "$"; ואם אחריו אני לוחץ sell הסכום שלאחר הקנייה עולה ב5: if(totalmoney == startmoney - lose) { totalmoney = startmoney - lose; newtotalmoney = totalmoney +incom; lbl_total_money.Text = newtotalmoney + "$"; אבל שאני לוחץ שוב על BUY הסכום יורד ב5 למרות שהגדרתי int lose=10; עשיתי דיבאגינג ניסיתי לשנות את הניסוח של הקוד לא עזר זה הקוד המלא int incom=5; int lose=10; int startmoney = 20; int totalmoney ; int newtotalmoney; private void BTN_BUY_MouseClick(object sender, MouseEventArgs e) { if (totalmoney == startmoney+incom) { totalmoney = startmoney +incom; newtotalmoney = totalmoney - lose; lbl_total_money.Text = newtotalmoney+ "$"; } else { totalmoney = startmoney - lose; lbl_total_money.Text = totalmoney + "$"; } } private void BTN_SELL_Click(object sender, EventArgs e) { incom = 5; if(totalmoney == startmoney - lose) { totalmoney = startmoney - lose; newtotalmoney = totalmoney +incom; lbl_total_money.Text = newtotalmoney + "$"; } else { totalmoney = startmoney + incom; lbl_total_money.Text = totalmoney + "$"; } } private void lbl_total_money_Click(object sender, EventArgs e) { זה לא רלוונטי } אני מקווה שזה יותר ברור
  7. אני בן 20 התחלתי ללמוד תכנות בכיתה י ובחודשים האחרונים חזרתי ללמוד תכנות לבד יש לי ידע בc# וכבר עשיתי כמה תוכניות בconsole application בחודשיים האחרונים התחלתי להשתמש בforms אבל עכשיו יש לי כמה בעיות הראשונה היא איך עושים שיהיה אפשר ללחוץ על אותו כפתור כמה פעמים ברצף וזאת הבעיה השנייה: int incom=5; int lose=10; int startmoney = 20; int totalmoney ; int newtotalmoney; שאני לוחץ buy פעם ראשונה זה מוריד 10 מסכום: totalmoney = startmoney - lose; lbl_total_money.Text = totalmoney + "$"; ואם אחריו אני לוחץ sell הסכום שלאחר הקנייה עולה ב5: if(totalmoney == startmoney - lose) { totalmoney = startmoney - lose; newtotalmoney = totalmoney +incom; lbl_total_money.Text = newtotalmoney + "$"; אבל שאני לוחץ שוב על BUY הסכום יורד ב5 למרות שהגדרתי int lose=10; עשיתי דיבאגינג ניסיתי לשנות את הניסוח של הקוד לא עזר זה הקוד המלא int incom=5; int lose=10; int startmoney = 20; int totalmoney ; int newtotalmoney; private void BTN_BUY_MouseClick(object sender, MouseEventArgs e) { if (totalmoney == startmoney+incom) { totalmoney = startmoney +incom; newtotalmoney = totalmoney - lose; lbl_total_money.Text = newtotalmoney+ "$"; } else { totalmoney = startmoney - lose; lbl_total_money.Text = totalmoney + "$"; } } private void BTN_SELL_Click(object sender, EventArgs e) { incom = 5; if(totalmoney == startmoney - lose) { totalmoney = startmoney - lose; newtotalmoney = totalmoney +incom; lbl_total_money.Text = newtotalmoney + "$"; } else { totalmoney = startmoney + incom; lbl_total_money.Text = totalmoney + "$"; } } private void lbl_total_money_Click(object sender, EventArgs e) { זה לא רלוונטי } אני מקווה שזה יותר ברור
  8. אני בן 20, בשנים האחרונות התחלתי ללמוד תכנות בשפת c# שהתחלתי מכיתה י'. עכשיו אני משתמש בwindows forms app והתחלתי להכין משחק הצבתי labal שמשמש לסכום כסף ושני כפתורים אחד "buy" והשני"sell" הצלחתי לסנכרן ביניהם שאם קודם לוחצים על buy הסכום יורד ומופיע בlabel ואז שלוחצים על sell הסכום של אחרי הקנייה עולה ומופיע בlabel (ולהיפך) הבעיה היא שלא הצלחתי להגדיר שיהיה אפשר ללחוץ על אותו כפתור פעמיים או יותר ברצף?????
×
  • צור חדש...