Click here to Skip to main content
14,427,747 members
   

C#

 
AnswerRe: acording to me you are wrong Pin
Guffa21-Jul-08 12:35
MemberGuffa21-Jul-08 12:35 
Generali am ashamed :( [modified] Pin
enginço21-Jul-08 22:12
Memberenginço21-Jul-08 22:12 
QuestionsipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 2:27
MemberAtif Ali Bhatti21-Jul-08 2:27 
AnswerRe: sipXtapdotnet api, help required. Pin
Ashfield21-Jul-08 2:40
MemberAshfield21-Jul-08 2:40 
GeneralRe: sipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 2:43
MemberAtif Ali Bhatti21-Jul-08 2:43 
GeneralRe: sipXtapdotnet api, help required. Pin
DaveyM6921-Jul-08 4:04
professionalDaveyM6921-Jul-08 4:04 
GeneralRe: sipXtapdotnet api, help required. Pin
Atif Ali Bhatti21-Jul-08 20:22
MemberAtif Ali Bhatti21-Jul-08 20:22 
QuestionFinding an menuItem in the MenuContext Pin
steve_rm21-Jul-08 2:24
Membersteve_rm21-Jul-08 2: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 2:00
Memberhhseiki21-Jul-08 2:00 
QuestionLow Virtual memory problem with Memory Stream? Pin
DeepOceans21-Jul-08 1:39
MemberDeepOceans21-Jul-08 1:39 
Answer[Message Deleted] Pin
AtulRane21-Jul-08 2:04
MemberAtulRane21-Jul-08 2:04 
GeneralRe: Low Virtual memory problem with Memory Stream? Pin
Simon P Stevens21-Jul-08 3:52
MemberSimon P Stevens21-Jul-08 3:52 
GeneralRe: Low Virtual memory problem with Memory Stream? Pin
Paul Conrad21-Jul-08 5:38
subeditorPaul Conrad21-Jul-08 5:38 
AnswerRe: Low Virtual memory problem with Memory Stream? Pin
Paddy Boyd21-Jul-08 3:33
MemberPaddy Boyd21-Jul-08 3:33 
QuestionCreating an Auto- Web Form Filler Application Pin
Raj-Ekoham DwitiyoNasti21-Jul-08 1:25
MemberRaj-Ekoham DwitiyoNasti21-Jul-08 1:25 
AnswerRe: Creating an Auto- Web Form Filler Application Pin
Raj-Ekoham DwitiyoNasti21-Jul-08 2:38
MemberRaj-Ekoham DwitiyoNasti21-Jul-08 2:38 
Questionin c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
neeka21-Jul-08 0:19
Memberneeka21-Jul-08 0:19 
AnswerRe: in c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
leppie21-Jul-08 0:23
Memberleppie21-Jul-08 0:23 
GeneralRe: in c # how to make a control which shape is a line(not only horizontal and vertical but also bias) Pin
neeka21-Jul-08 0:33
Memberneeka21-Jul-08 0:33 
QuestionCustom Control / Property Grid Pin
c242321-Jul-08 0:18
Memberc242321-Jul-08 0:18 
AnswerRe: Custom Control / Property Grid Pin
leppie21-Jul-08 0:22
Memberleppie21-Jul-08 0:22 
GeneralRe: Custom Control / Property Grid Pin
c242321-Jul-08 0:28
Memberc242321-Jul-08 0:28 
AnswerRe: Custom Control / Property Grid Pin
darkelv21-Jul-08 0:27
Memberdarkelv21-Jul-08 0:27 
GeneralRe: Custom Control / Property Grid Pin
c242321-Jul-08 0:30
Memberc242321-Jul-08 0:30 
QuestionFormat BoundColumn Text Pin
Member 426786721-Jul-08 0:07
MemberMember 426786721-Jul-08 0: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.