Laman

Jumat, 31 Desember 2010

Membuat Loadingbar dengan di C# (C sharp)

kali ini adalah tutorial tentang membuat loading bar, langsung saja kita buat projectnya, kilik file new project pada IDE visual studio 2005 atau 2008 ataupun 2010. pada kotak project name silahkan diisi sesuai keinginan. selanjutnya ikuti instruksi dibawah ini
langkah 1 : tambahkan satu komponen progessbar dan satu komponen backgroundWorker pada form1, atur dan tata sedemikain rupa sehingga tampilannya seperti pada gambar dibawah

Gambar 1. Preview desain aplikasi 

langkah 2 : double klik pada form satu, tambakan librabry thread pada header program, tambahakan header berikut ini 
       using.system.thread
langkah 3 : pada event form1_load tambahkan code berikut ini
       backgroundWorker1.RunWorkerAsync();
sekedar catatan, untuk membangkitkan event form1_load, double klik diarea kosong pada form1

langkah 4 : Double cklik pada icon backgroundWorker yang ada dipojok kanan bawah.  perhatikan gambar dibawah ini, 

Gambar 2. Preview jendela desain aplikasi di visual studio 2010

tambahkan code berikut ini
     for (int i = 0; i <= 100; i++)
            {
                Thread.Sleep(100);
                backgroundWorker1.ReportProgress(i);
            }

Langkah 5 : Pada event backgroundWorker1_ProgressChanged tambahkan code seperti berikut ini
            progressBar1.Value = e.ProgressPercentage;
            this.Text = e.ProgressPercentage.ToString();

Untuk mengaktifkan event diatas, select backgroundWorker pada form, setelah itu perhatikan pada kotak properties, klik tanda petir  dan double clik pada field  ProgessChanged, untuk lebih jelasnya perhatikan gambar dibawah ini

Gambar 3. Preview jendela event di Microsoft Visual Studio 2010

langkah 6 : Done,silahkan running program, jika langkah-langkah diatas dilakukan dengan benar, maka program saat dirunning akan muncul loading bar selama 10 detik. agar mempermudah dalam memahai source code, 

download contoh programnya disini, 
dowload full projectnya disini.
for more information contact us on informasi@csharp-indonesia.com 

for more information contact us on informasi@csharp-indonesia.com
NB : Dalam tutorial ini program ditulisa menggunakan IDE Visual studio 2010. dengan target framework 2.0 . Sehingga minimal komputer harus terinstal windows xp untuk bisa menjalankan program *.exe nya, Sedangkan untuk membuka projectnya mau tidak mau harus menginstal microsoft visual studio 2010

22 komentar:

  1. gan,,
    bsa minta emailnya....? ?
    thanks..

    BalasHapus
  2. minta emailnya donk masbro. terima kash.

    BalasHapus
  3. One of the reasons Ray-Ban has managed to stay top of mind with consumers has to do with Hollywood culture. Cult films such as Rebel Without a Cause, Breakfast at Tiffany's, and The Blues Brothers have helped popularize Ray-Ban's Wayfarer's, while movies ray ban wayfarer including Top Gun and Taxi Driver have done the same for Aviators.What do you like most about Ray-Ban's classic designs? Tell us in the comments below.Sunglasses maker Ray-Ban is spinning a new take on the traditional campaign for change by appealing to the humorous side of consumers through social media.
    Aviators were originally designed to protect the eyes of pilots with their shaded lenses that filtered out sunlight without blocking vision. ray ban glasses The minimal frames and dark lenses of Aviators have been copied by many other brands, but they are still considered the defining brand of these glasses. Many famous people have worn Aviators, including:General Douglas MacArthur in the Philippines. The French Army is also said to have widely worn Ray-Bans while in the Far East.Aviators were primarily a male sunglasses fashion type, but women also wore them. In fact, Aviators have come to symbolize ray ban sale serious attention to eye protection in a variety of fields including flying, driving and any job that requires protection from glare.Brand name sunglass fakes or knockoffs are quite common. While Simply Sunglasses guarantees that you will only receive real, certified Ray-Bans, it helps to be able ray ban clubmaster to spot a fake when you see one. Here are some tips for identifying “knockoffs.”
    So, jeepers creepers, why is Ray-Ban saying, “Don’t shade your peepers”? The idea is to find a playful way to encourage younger consumers, particularly those ages 18 to 25, to assert their individuality by revealing their sense of personal style.“It struck us as an ironic way to say, ‘Express yourself,’ ” said Chuck McBride, executive creative director for North America at the San Francisco office of the Ray-Ban creative agency, TBWA/Chiat/Day, part of the TBWA Worldwide division of the Omnicom Group.In research, “people said it was a little mixed up,” he ray ban outlet added, “but they got the intent.”
    Recently, apparel and accessories retailer Coach took a similar approach and invited Insta-famous personalities to customize pictures of bags in their own manner to celebrate consumer individuality (see more).Furthermore, according to a panel at Forrester’s Forum for Marketing Leaders, brands that market through social media need to focus on creating overall authenticity and positive image through multiple channels (see more). Brands such as Coach and Ray-Ban are ray ban sunglasses following that format with these campaigns.

    BalasHapus