Click here to Skip to main content
15,895,192 members
Home / Discussions / C#
   

C#

 
General.NET Logging Framework (database) Pin
pankazmittal4-Aug-05 6:13
pankazmittal4-Aug-05 6:13 
GeneralRe: .NET Logging Framework (database) Pin
Dave Kreskowiak4-Aug-05 6:28
mveDave Kreskowiak4-Aug-05 6:28 
GeneralRe: .NET Logging Framework (database) Pin
Steve Maier4-Aug-05 6:42
professionalSteve Maier4-Aug-05 6:42 
GeneralMatch percentage between two string Pin
Member 17237104-Aug-05 5:50
Member 17237104-Aug-05 5:50 
GeneralRe: Match percentage between two string Pin
Dave Kreskowiak4-Aug-05 6:24
mveDave Kreskowiak4-Aug-05 6:24 
GeneralRe: Match percentage between two string Pin
Patric_J5-Aug-05 5:23
Patric_J5-Aug-05 5:23 
GeneralMDI Form Toggling Using Custom Buttons Pin
lpointer4-Aug-05 5:06
lpointer4-Aug-05 5:06 
GeneralRe: MDI Form Toggling Using Custom Buttons Pin
Luis Alonso Ramos4-Aug-05 5:46
Luis Alonso Ramos4-Aug-05 5:46 
I guess you could try SelectNextControl on the MDI parent form (or is it the MDI client, I would guess). I don't know it if will work (probaby not), but try it.

If it doesn't work, you have the array of MDI children (in the MdiChildren property.) Find the current active child (ActiveMdiChild) in the array, and then ActivateMdiChild the previous or the next in the array. It's not so hard:
void SelectNextMdiChild(bool next)
{
    if(MdiChildren.Length <= 1)
        return;

    From current = ActiveMdiChild;
    for(int i = 0; i < MdiChildren.Lenght; i++)
    {
        if(MdiChildren[i] == current)
        {
            // The first window is the active one and the user
            // wants the previous?
            if(!next && i == 0)
            {
                // Activate the one at the end
                ActivateMdiChild(MdiChildren[MdiChildren.Length - 1])
            }
            else if(next && i == MdiChildren.Length - 1)
            {
                // Last window and looking for next window?
                // activate the first one
                ActivateMdiChild(MdiChildren[0]);
            }
            else
            {
                if(next)
                    ActivateMdiChild(MdiChildren[i + 1]);
                else
                    ActivateMdiChild(MdiChildren[i - 1]);
            }

            return;
        }
    }
}
I just wrote that code and didn't test it, but it should achieve your desired effect.

Good luck!

-- LuisR



Luis Alonso Ramos
Intelectix - Chihuahua, Mexico

Not much here: My CP Blog!

GeneralDropDownList comboBoxes Pin
patgo4-Aug-05 4:14
patgo4-Aug-05 4:14 
GeneralRe: DropDownList comboBoxes Pin
mav.northwind4-Aug-05 5:30
mav.northwind4-Aug-05 5:30 
GeneralRe: DropDownList comboBoxes Pin
patgo5-Aug-05 2:30
patgo5-Aug-05 2:30 
Generalindex of a Row Pin
zaboboa4-Aug-05 4:07
zaboboa4-Aug-05 4:07 
GeneralRe: index of a Row Pin
Guffa4-Aug-05 4:38
Guffa4-Aug-05 4:38 
GeneralRe: index of a Row Pin
Alomgir Miah4-Aug-05 4:45
Alomgir Miah4-Aug-05 4:45 
GeneralRe: index of a Row Pin
zaboboa4-Aug-05 6:46
zaboboa4-Aug-05 6:46 
QuestionHow to get Attribute in XPath ? Pin
Anonymous4-Aug-05 3:48
Anonymous4-Aug-05 3:48 
AnswerMissed XML Part Pin
Anonymous4-Aug-05 4:13
Anonymous4-Aug-05 4:13 
GeneralRe: Missed XML Part Pin
Kevin McFarlane4-Aug-05 4:48
Kevin McFarlane4-Aug-05 4:48 
GeneralDataView.Sort not working Pin
livez4-Aug-05 3:21
livez4-Aug-05 3:21 
GeneralRe: DataView.Sort not working Pin
Alomgir Miah4-Aug-05 4:05
Alomgir Miah4-Aug-05 4:05 
GeneralRe: DataView.Sort not working Pin
livez4-Aug-05 4:13
livez4-Aug-05 4:13 
GeneralRe: DataView.Sort not working Pin
Alomgir Miah4-Aug-05 4:45
Alomgir Miah4-Aug-05 4:45 
GeneralRe: DataView.Sort not working Pin
livez4-Aug-05 4:59
livez4-Aug-05 4:59 
GeneralClass Constructor not getting called when creating array of class object Pin
Mutty4-Aug-05 3:15
Mutty4-Aug-05 3:15 
GeneralRe: Class Constructor not getting called when creating array of class object Pin
Sean Michael Murphy4-Aug-05 3:32
Sean Michael Murphy4-Aug-05 3:32 

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.