עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

איך משנים תמונה כל כמה שניות ב#C, ב FORM ?

Featured Replies

פורסם

אני הייתי עושה משהו בסגנון הזה

namespace Image_Rotation
{
public partial class Form_1 : Form
{
public Form_1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

//set timer intrval
Change_Timer.Interval = 1000;
//start timer
Change_Timer.Start();


}

private void Change_Timer_Tick(object sender, EventArgs e)
{
//for each timer tick do:

//set some sort of condition
Random randomGen = new Random();
int randomNumber = randomGen.Next(1, 3);
//draw image
switch (randomNumber)
{
case 1:
pictureBox1.Image = Image_Rotation.Properties.Resources.Image1;
break;
case 2:
pictureBox1.Image = Image_Rotation.Properties.Resources.Image2;
break;
}


}

}
}

את החלפת התמונות לעשות בטיימר עצמו, ככה אפשר לכל טיימר להקצות משהו משלו, אני תמיד נמנע מלתקוע דברים בform_load זה סתם טוען המון דברים ישר שלא בטוח שצריך בכלל. :P

פורסם
  • מחבר

הצלחתי, מודה מקרב לב לכל העוזרים, המון תודה על הסבלנות וההסברים המפורטים !!!

פורסם

מה עשית בסוף? מבחינת ביצועים לעשות refresh לכל הform זה טחינה, תשתמש באובייקט יעודי כמו panel/picturebox, כמו כן אל תטען עם לינק מהדיסק הקשיח, תוסיף כל מה שאתה יכול בתור resource לפרוייקט כיוון שאז זה נטען לזכרון פעם אחת.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.