473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Out of the Box Microsoft Feature - Tricking out your application questions

I've been studying the Tricking out your applications code at
microsofts
website

http://msdn.microsoft.com/coding4fun...p/default.aspx

and its... tricked me out - In particular i'm having trouble with the
following:-
public TrickForm()
{
InitializeComponent();

backgroundComboBox.Items.Add(
new TaggedString("RoundedAAA",
Properties.Resources.RoundedFrame));
backgroundComboBox.Items.Add(
new TaggedString("Star",
Properties.Resources.StarFrame));
backgroundComboBox.Items.Add(
new TaggedString("Gear",
Properties.Resources.GearFrame));
}
private void backgroundComboBox_SelectedIndexChanged(object sender,
EventArgs e)

{
TaggedString val =
(TaggedString)backgroundComboBox.SelectedItem;
Bitmap bmp = (Bitmap)val.Tag;

SetFormBackgroundImage(bmp);
}

These two bits of code are really confusing me.
I can't find out what a taggedstring is anywhere in a simple to
understand
definition - i'm a hobbyist am trying hard to get to grips with the
heavy
concepts behind all this .net framework.

What is a taggedstring?
why is it proceeded with the word new?
what does properties.resources.roundedframe refer to?
where are the pictures stored? I can't find an image holder, how does
the
combo box know which image to associate with which index number?

if somebody could answer those questions, and then line by line
work through the above 10 or so lines of code and tell me EXACTLY in
english what's going on i'd really appreciate it.

Thanks,

Gary Moylan.

Mar 15 '06 #1
3 1045

ga********@myway.com wrote:
I've been studying the Tricking out your applications code at
microsofts
website

http://msdn.microsoft.com/coding4fun...p/default.aspx

and its... tricked me out - In particular i'm having trouble with the
following:- [snip]
These two bits of code are really confusing me.
I can't find out what a taggedstring is anywhere in a simple to
understand
definition - i'm a hobbyist am trying hard to get to grips with the
heavy
concepts behind all this .net framework.

What is a taggedstring?
TaggedString is a class defined in the *same file* that the above code
is found in.
why is it proceeded with the word new?
To create a new instance...
what does properties.resources.roundedframe refer to?
The RoundedFrame image in the project's resources. In the solution
explorer, expand the 'Properties' node and double click Resources.resx
to see the project's resources.
where are the pictures stored?
In the resources.
I can't find an image holder, how does
the
combo box know which image to associate with which index number?
The items in the combobox are TaggedStrings; when one is selected, the
image is extracted from the item itself (in
backgroundComboBox_SelectedIndexChanged), without ever needing an index
number.
if somebody could answer those questions, and then line by line
work through the above 10 or so lines of code and tell me EXACTLY in
english what's going on i'd really appreciate it.


Not being funny, but a book is a better way to learn C# than a
newsgroup. There have been lots of threads here talking about good C#
books.

--
Larry Lard
Replies to group please

Mar 15 '06 #2
Thankyou I have gone through the learnvisualstudio 200 page odd ebook
and videos.. so have made some efforts at more orthodox learning! But
i'm trying to create a project at the moment and instead of spending
hours at the start of a book i'm trying to learn the things I need to
complete this project as i go along.. and then when I have more time
study the theory side in more detail.

Your reply helped me out alot! I know understand that the taggedstring
actually contains the image, that's where the confusion was.. I keep
forgetting what a method is though (that sounds so silly..) so i'm
going to have to refresh my memory!

Thanks again,
Gary.

Mar 15 '06 #3

<ga********@myway.com> wrote in message
news:11**********************@j52g2000cwj.googlegr oups.com...
I've been studying the Tricking out your applications code at
microsofts
website

http://msdn.microsoft.com/coding4fun...p/default.aspx

and its... tricked me out - In particular i'm having trouble with the
following:-
public TrickForm()
{
InitializeComponent();

backgroundComboBox.Items.Add(
new TaggedString("RoundedAAA",
Properties.Resources.RoundedFrame));
backgroundComboBox.Items.Add(
new TaggedString("Star",
Properties.Resources.StarFrame));
backgroundComboBox.Items.Add(
new TaggedString("Gear",
Properties.Resources.GearFrame));
}
private void backgroundComboBox_SelectedIndexChanged(object sender,
EventArgs e)

{
TaggedString val =
(TaggedString)backgroundComboBox.SelectedItem;
Bitmap bmp = (Bitmap)val.Tag;

SetFormBackgroundImage(bmp);
}

These two bits of code are really confusing me.
I can't find out what a taggedstring is anywhere in a simple to
understand
definition - i'm a hobbyist am trying hard to get to grips with the
heavy
concepts behind all this .net framework.

What is a taggedstring?
why is it proceeded with the word new?
what does properties.resources.roundedframe refer to?
where are the pictures stored? I can't find an image holder, how does
the
combo box know which image to associate with which index number?

if somebody could answer those questions, and then line by line
work through the above 10 or so lines of code and tell me EXACTLY in
english what's going on i'd really appreciate it.

Thanks,

Gary Moylan.


Gary, check out the free C# beginner videos at
http://msdn.microsoft.com/vstudio/ex...g/default.aspx

Regards,

Robert
Mar 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: theodp | last post by:
Not to be outdone by Amazon's 1-Click patent, Microsoft snagged a patent from the USPTO Tuesday for a 'Time based hardware button for application launch', which covers causing different actions to...
1
by: Novice | last post by:
Hi all, I am a C++ and Java developer with over 3 years of industry experience. I've written low level C++ code, in addition to web clients that use web services. I've just recently installed the...
99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
1
by: R Reyes | last post by:
ISSUE (reposted) =========================== Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? For many people, they say they add the...
0
by: pedaammulu | last post by:
Hi All, New title for Mastering Web Application Development. All secrets of developing an Accounting Software for the web revealed. Title: "Develop your own Web Accounting Application...
1
by: chris | last post by:
This topic is to get some details about the Event Validation feature in ASP.NET 2.0. I have researched this topic quite a bit via the web, and understand, for the most part how this works and why...
3
by: RP | last post by:
I want to clear Microsoft certification next month for .NET. I am preparing for the MCTS exam 70-536 that is ".NET Framework 2.0 Application Development Foundation". Since .NET 3.5 is already...
23
by: =?Utf-8?B?TWlrZTE5NDI=?= | last post by:
This is an example that is supposed to work in VB http://support.microsoft.com/kb/175512/en-us After spending a couple of hours downloading and installing VB Express 2008 after someone told me it...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.