WPF Basics: How To Add Controls Dynamically at Run Time
Adding controls at run time using VB.NET in Windows Forms is fairly well-documented. Finding C# code-behind samples for doing this with WPF controls under Framework 3.0 is also an easy task.
But I recently wanted to see how to do this with a WPF application in Visual Basic 2008 and I found that at the time of writing my searches produced no useful clear "How To" results.
Direct conversion from C# to VB using the current conversion tools didn't always identify some essential code elements, resulting in quite a frustrating time spent finding the correct way of doing this. (Not an unusual scenario nowadays, as more and more samples - including too many MSDN ones - seem to have only C# samples available).
Along the way I also discovered that not everything is as it seems - apparently difficult things were easy; things that seemed they should be easy turned out to be more difficult.
And of course as is often the case it turns out that there is more than one way to do most things.
Once you have solved the puzzles it all seems easy, but I thought I'd save you the trouble of having to work out the steps involved if you should need to do this before better Visual Basic documentation becomes available.
You can link to the first page of my article here.
http://www.xtabvbcity.plus.com/Articles/WPFDynamicControls1/WPFDynamicControls1_Page1.htm or http://vbcode.my-php.net
source :http://blogs.vbcity.com
-------------------------------------------------------
Trik Gambar Bergerak
Trik Gambar-dimouse
Trik hapus pwd mysql
Trik insertin to db
Trik jadi root dilinux
Trik jam-distatus-bar
Trik Koneksi-ke database
Trik Koneksi-msql-php
Trik lihat-database-mysql
Trik membahas-fungsi-else
Trik member-area
Rabu, 04 Februari 2009
Langganan:
Postingan (Atom)