close

4258

C#的HScrollBar控制項的問題

BACKGND.bmp http://img300.imageshack.us/img300/8576/backgndkf2.pngRUNNER1.GIF http://img300.imageshack.us/img300/245/runner1wx8.gifRUNNER2.GIF http://img300.imageshack.us/img300/1615/runner2cl9.gifRUNNER3.GIF http://img300.imageshack.us/img300/8452/runner3on7.gifRUNNER4.GIF http://img510.imageshack.us/img510/4258/runner4wn8.gif操作步驟慢跑動畫是由『RUNNER1.GIF』、『RUNNER2.GIF』、『RUNNER3.GIF』、『RUNNER4.GIF』四個圖檔每隔0.1秒依序輪流放入PictureBox圖片方塊控制項內

而PictureBox控制項每隔0.1秒由右往左移動

當跑者跑出表單的左邊界

馬上又從表單的右邊界跑進來。

建立Timer控制項用來即時及產生動畫

加入HScrollBar控制項

該控制項可用調整跑者動畫速度。

請問HScrollBar如何調整跑者動畫速度?原程式碼using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace picRunner{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } int picNo = 0; PictureBox[] pics; private void Form1_Load(object sender

EventArgs e) { picRunner.Location = new Point(this.Width

130); pics = new PictureBox[] { pic1

pic2

pic3

pic4 }; timer1.Enabled = true; } private void timer1_Tick(object sender

EventArgs e) { picNo ; if (picNo

arrow
arrow
    創作者介紹
    創作者 AM-4201風速計 的頭像
    AM-4201風速計

    《富豪傳奇》

    AM-4201風速計 發表在 痞客邦 留言(0) 人氣()