Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,095 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,624 people online right now. Registration is fast and FREE... Join Now!




PC_RSSReader compile error

 
Reply to this topicStart new topic

PC_RSSReader compile error

JoeGribb
12 Nov, 2007 - 06:01 PM
Post #1

New D.I.C Head
*

Joined: 12 Nov, 2007
Posts: 2


My Contributions
I'm trying to learn about RSS using PsychoCoder's PC_RSSReader. All went well, and I can even understand most of it (not good at collections yet). I got two similar errors I can't figure out. They read:
'object' does not contain a definition for 'Text'
'object' does not contain a definition for 'SubItems'
These refer to the lines of code below where I added the ****.
I'm wondering if it has something to do with a property setting I need to define for the lstNews?

(entire file is attached.)

Thanks,
Joe G.



CODE

private void lstNews_SelectedIndexChanged(object sender, EventArgs e)
        {
            //check to make sure an item is selected
            if (lstNews.SelectedItems.Count == 1)
            {
                //Loop through all the items in the list
                for (int i = 0; i < list.Count; i++)
                {
                    //check and see if the selected title
                    //in the List Box matches the current
                    // of the list
                      if (list[i].Title == lstNews.SelectedItems[0].Text)  ****
                    {
                        //set the description to the TextBox.Text
                        txtURL.Text = list[i].Description.Substring(0, 250);
                    }
                }
            }
      
    }
        private void lstNews_DoubleClick(object sender, EventArgs e)
        {
            //When double clicked open the web page
            System.Diagnostics.Process.Start(lstNews.SelectedItems[0].SubItems[1].Text); ****
        }



Attached File(s)
Attached File  PC_RSSReader_Gribb.zip ( 20.88k ) Number of downloads: 45
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: PC_RSSReader Compile Error
12 Nov, 2007 - 06:47 PM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8600
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Let me look through your code but the code I have in that tutorial is the exact code I have in the RSS reader I use myself, copied and pasted right from the class file & application.
User is online!Profile CardPM
+Quote Post

PsychoCoder
RE: PC_RSSReader Compile Error
12 Nov, 2007 - 06:53 PM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8600
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
This is really weird, I copied the ListBox SelectedIndexChanged event code you pasted directly into my reader and it compiled and worked perfectly. I'm now going to download your version and see what the difference is
User is online!Profile CardPM
+Quote Post

PsychoCoder
RE: PC_RSSReader Compile Error
12 Nov, 2007 - 07:04 PM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8600
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
I found the problem! In my example I'm using a ListView, you're using a ListBox. Ill edit the tutorial and make sure to let people know they, if using it the way I am, need to use a ListView not a ListBox.

Sorry for the confusion smile.gif
User is online!Profile CardPM
+Quote Post

JoeGribb
RE: PC_RSSReader Compile Error
13 Nov, 2007 - 03:39 AM
Post #5

New D.I.C Head
*

Joined: 12 Nov, 2007
Posts: 2


My Contributions
QUOTE(PsychoCoder @ 12 Nov, 2007 - 08:04 PM) *

I found the problem! In my example I'm using a ListView, you're using a ListBox. Ill edit the tutorial and make sure to let people know they, if using it the way I am, need to use a ListView not a ListBox.

Sorry for the confusion smile.gif



Thanks, PC
I'll modify and play some more. I really appreciate your posting this tutorial.
If you're going to modify it, I recommend you go ahead and identify the names you give for your controls. That took me a while to dig through and name them correctly.

Again, Thanks.

Joe G.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 08:37PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month