Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: acording to me you are wrong Pin
Guffa21-Jul-08 11:35
Guffa21-Jul-08 11:35 
Generali am ashamed :( [modified] Pin
enginço21-Jul-08 21:12
enginço21-Jul-08 21:12 
QuestionsipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 1:27
Atif Ali Bhatti21-Jul-08 1:27 
AnswerRe: sipXtapdotnet api, help required. Pin
Ashfield21-Jul-08 1:40
Ashfield21-Jul-08 1:40 
GeneralRe: sipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 1:43
Atif Ali Bhatti21-Jul-08 1:43 
GeneralRe: sipXtapdotnet api, help required. Pin
DaveyM6921-Jul-08 3:04
professionalDaveyM6921-Jul-08 3:04 
GeneralRe: sipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 19:22
Atif Ali Bhatti21-Jul-08 19:22 
QuestionFinding an menuItem in the MenuContext Pin
steve_rm21-Jul-08 1:24
steve_rm21-Jul-08 1:24 
Hello,

VS 2008

I am adding menuItems to a menuContext. However, I only want to allow a maximum of 10 menuItems to be added. This works ok.

However, if a menuItem is about to be added. Which is already contained in the menuContext. Then I want to get the index of this, so that I can remove it. And add in index 0.

The idea is to add phone numbers, and display the most recent one that was dialed. This is why I am adding at index 0. However, if a phone number is already in the menuContext then I need to find it so that I can remove it.

I have tried using the contains, Find, and IndexOf methods, but no use. See comments below.

I have tried using the Dictionary and IList to keep track of the items. However, this doesn't seem be the right solution either.

Many thanks for any suggestions,

<br />
//Dictionary<int,> RedialedItems = new Dictionary<int,>(); <br />
        //IList<string> dialedNumbers; <br />
 <br />
        //Add a new number to the redial history <br />
        public void AddToRedialHistory(string number) <br />
        { <br />
            this.shortcutRedialMenu = new MenuItem(); <br />
            this.shortcutRedialMenu.Text = number; <br />
 <br />
             <br />
            //Trying to get an index of the value I am looking for. <br />
            //int index = this.ctxRedialMenu.MenuItems.IndexOf(shortcutRedialMenu); <br />
            //index = this.ctxRedialMenu.MenuItems.IndexOfKey("1"); <br />
            //index = Convert.ToInt16(this.ctxRedialMenu.MenuItems.Contains(shortcutRedialMenu)); <br />
 <br />
            //Only keep redial history for a maximum of 10 numbers. <br />
            //if greater then 10, remove the last one index 10. <br />
            int count = this.ctxRedialMenu.MenuItems.Count; <br />
            if (count > 9) <br />
            { <br />
                this.ctxRedialMenu.MenuItems.RemoveAt(9); <br />
            } <br />
 <br />
            //Add to the zero index so that all the number are displayed <br />
            //in reverse order. Most recent displayed at the top. <br />
            this.ctxRedialMenu.MenuItems.Add(0, shortcutRedialMenu); <br />
 <br />
            //Adding them to the dictionary. <br />
            //this.RedialedItems.Add(this.shortcutRedialMenu.Index, shortcutRedialMenu.Text); <br />
             <br />
            //Add event handler for clicking on the shortcut menu. <br />
            this.shortcutRedialMenu.Click += new EventHandler(this.ShortCutRedial_Clicked); <br />
        } </string>

QuestionHow to create a DropDownList like that of the Font list in Microsoft Word? Pin
hhseiki21-Jul-08 1:00
hhseiki21-Jul-08 1:00 
QuestionLow Virtual memory problem with Memory Stream? Pin
DeepOceans21-Jul-08 0:39
DeepOceans21-Jul-08 0:39 
Answer[Message Deleted] Pin
AtulRane21-Jul-08 1:04
AtulRane21-Jul-08 1:04 
GeneralRe: Low Virtual memory problem with Memory Stream? Pin
Simon P Stevens21-Jul-08 2:52
Simon P Stevens21-Jul-08 2:52 
GeneralRe: Low Virtual memory problem with Memory Stream? Pin
Paul Conrad21-Jul-08 4:38
professionalPaul Conrad21-Jul-08 4:38 
AnswerRe: Low Virtual memory problem with Memory Stream? Pin
Paddy Boyd21-Jul-08 2:33
Paddy Boyd21-Jul-08 2:33 
QuestionCreating an Auto- Web Form Filler Application Pin
Raj-Ekoham DwitiyoNasti21-Jul-08 0:25
Raj-Ekoham DwitiyoNasti21-Jul-08 0:25 
AnswerRe: Creating an Auto- Web Form Filler Application Pin
Raj-Ekoham DwitiyoNasti21-Jul-08 1:38
Raj-Ekoham DwitiyoNasti21-Jul-08 1:38 
Questionin c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
neeka20-Jul-08 23:19
neeka20-Jul-08 23:19 
AnswerRe: in c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
leppie20-Jul-08 23:23
leppie20-Jul-08 23:23 
GeneralRe: in c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
neeka20-Jul-08 23:33
neeka20-Jul-08 23:33 
QuestionCustom Control / Property Grid Pin
c242320-Jul-08 23:18
c242320-Jul-08 23:18 
AnswerRe: Custom Control / Property Grid Pin
leppie20-Jul-08 23:22
leppie20-Jul-08 23:22 
GeneralRe: Custom Control / Property Grid Pin
c242320-Jul-08 23:28
c242320-Jul-08 23:28 
AnswerRe: Custom Control / Property Grid Pin
darkelv20-Jul-08 23:27
darkelv20-Jul-08 23:27 
GeneralRe: Custom Control / Property Grid Pin
c242320-Jul-08 23:30
c242320-Jul-08 23:30 
QuestionFormat BoundColumn Text Pin
Member 426786720-Jul-08 23:07
Member 426786720-Jul-08 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.