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

  • Thread starter Thread starter garyusenet
  • Start date Start date
G

garyusenet

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

http://msdn.microsoft.com/coding4fun/inthebox/trickedoutapp/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.
 
I've been studying the Tricking out your applications code at
microsofts
website

http://msdn.microsoft.com/coding4fun/inthebox/trickedoutapp/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.
 
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.
 
I've been studying the Tricking out your applications code at
microsofts
website

http://msdn.microsoft.com/coding4fun/inthebox/trickedoutapp/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/express/visualcsharp/learning/default.aspx

Regards,

Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top