Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
Questionvoice chat Pin
kevinpiper12322-Oct-09 17:30
kevinpiper12322-Oct-09 17:30 
AnswerRe: voice chat Pin
Christian Graus22-Oct-09 17:34
protectorChristian Graus22-Oct-09 17:34 
QuestionAutonumber and refresh form, C sharp Pin
misCafe22-Oct-09 16:54
misCafe22-Oct-09 16:54 
AnswerRe: Autonumber and refresh form, C sharp Pin
Christian Graus22-Oct-09 17:10
protectorChristian Graus22-Oct-09 17:10 
GeneralRe: Autonumber and refresh form, C sharp Pin
misCafe22-Oct-09 18:04
misCafe22-Oct-09 18:04 
QuestionI am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
chungdovn22-Oct-09 11:57
chungdovn22-Oct-09 11:57 
AnswerRe: I am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
Not Active22-Oct-09 12:05
mentorNot Active22-Oct-09 12:05 
AnswerRe: I am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
Christian Graus22-Oct-09 12:09
protectorChristian Graus22-Oct-09 12:09 
GeneralRe: I am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
FyreWyrm22-Oct-09 15:28
FyreWyrm22-Oct-09 15:28 
GeneralRe: I am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
Christian Graus22-Oct-09 17:09
protectorChristian Graus22-Oct-09 17:09 
GeneralRe: I am coding in C# on Webform, who can show me the way to send SMS from Webform? thanks! Pin
benjymous22-Oct-09 22:28
benjymous22-Oct-09 22:28 
Questionchange win form name Pin
jashimu22-Oct-09 9:53
jashimu22-Oct-09 9:53 
AnswerRe: change win form name Pin
DaveyM6922-Oct-09 10:15
professionalDaveyM6922-Oct-09 10:15 
GeneralRe: change win form name Pin
jashimu22-Oct-09 10:29
jashimu22-Oct-09 10:29 
GeneralRe: change win form name Pin
EliottA22-Oct-09 11:10
EliottA22-Oct-09 11:10 
Questionhow to make a form reference public? Pin
genisyssoftware22-Oct-09 8:47
genisyssoftware22-Oct-09 8:47 
AnswerRe: how to make a form reference public? [modified] PinPopular
DaveyM6922-Oct-09 8:58
professionalDaveyM6922-Oct-09 8:58 
GeneralRe: how to make a form reference public? Pin
Christian Graus22-Oct-09 17:35
protectorChristian Graus22-Oct-09 17:35 
GeneralRe: how to make a form reference public? Pin
dan!sh 22-Oct-09 17:45
professional dan!sh 22-Oct-09 17:45 
QuestionHow to drag image from my picturebox to other application(ex.Photoshop) Pin
Kortez222322-Oct-09 7:57
Kortez222322-Oct-09 7:57 
AnswerRe: How to drag image from my picturebox to other application(ex.Photoshop) Pin
Christian Graus22-Oct-09 12:10
protectorChristian Graus22-Oct-09 12:10 
QuestionMouseMove event firing even though I'm not moving my mouse! Pin
WebMaster22-Oct-09 7:51
WebMaster22-Oct-09 7:51 
OK, so I have my TabControl, which is by the way owner drawn, and I have my TabPages. I want to make the user able to, when a TabPage is clicked and the mouse is moving, move the contents of the TabPage. Now, the moving is working, but my MouseMove event is firing even though my mouse isn't moving!

This is the code:

protected override void OnMouseMove(MouseEventArgs e)
{
    base.OnMouseMove(e);

    bool foundItem = false;
    int index = -1;

    foreach (TabPage page in this.TabPages)
    {
        index++;
        if (this.GetTabRect(index).Contains
            (e.Location) == true)
        {
            _hoverIndex = index;
            this.Invalidate();
            foundItem = true;

            if (this.TabMouseEnter != null)
            {
                TabMouseEventArgs tabArgs = new TabMouseEventArgs();
                tabArgs.TabPage = page;

                this.TabMouseEnter(this, tabArgs);
            }
        }
        else if (foundItem == false)
        {
            _hoverIndex = -1;
            this.Invalidate();

            if (this.TabMouseLeave != null)
            {
                TabMouseEventArgs tabArgs = new TabMouseEventArgs();
                tabArgs.TabPage = page;

                this.TabMouseLeave(this, tabArgs);
            }
        }
    }

    if (e.Button == MouseButtons.Left)
    {
        if (_hoverIndex != -1)
        {
            // Store the current DockStyle to a variable so we can re-use it when we
            // will re-add all the remaining Forms to the parent DockPane.

            DockStyle dockStyle = this.DockPanel.Dock;

            // Aaaand hide the dock Rectangles.

            this.DockPanel.DockPane.HideDockRectangles();

            // We should now create a new DockForm with the dragging TabPage's contents.

            DockForm dockForm = new DockForm();
            DockPanel dockPanel = this.DockPanel;

            this.DockPanel.DockPane.Controls.Remove(dockPanel);
            dockPanel.Dock = DockStyle.Fill;

            dockForm.Location = Cursor.Position;
            dockForm.Controls.Add(dockPanel);
            dockForm.Renderer = this.Renderer;
            dockForm.Show();

            this.DockPanel.DockForm = dockForm;

            // Loop through all the TabPages of the DockTab and remove all TabPages that
            // are not the MainTabPage of the parent DockPanel.

            List<TabPage> removePages = new List<TabPage>();
            foreach (TabPage page in this.TabPages)
            {
                if (page != this.DockPanel.MainTabPage)
                    removePages.Add(page);
            }

            // We found all the tabs that needs to be removed - remove them from this
            // DockTab, and re-add their contents to the DockPane.

            foreach (TabPage page in removePages)
            {
                foreach (Control control in page.Controls)
                {
                    if (control is DockContainer)
                    {
                        DockContainer container = control as DockContainer;
                        this.DockPanel.DockPane.CreatePanel(container.Form, dockStyle); // Add the found Form to the parent DockPane.

                        // Finally remove the TabPage.
                        this.TabPages.Remove(page);
                    }
                }
            }
        }
    }
}


This is really the only related code. Any ideas?
AnswerRe: MouseMove event firing even though I'm not moving my mouse! Pin
Eddy Vluggen22-Oct-09 8:29
professionalEddy Vluggen22-Oct-09 8:29 
GeneralRe: MouseMove event firing even though I'm not moving my mouse! Pin
WebMaster22-Oct-09 8:43
WebMaster22-Oct-09 8:43 
QuestionCAPICOM Process replacement Pin
Dave Kreskowiak22-Oct-09 7:49
mveDave Kreskowiak22-Oct-09 7:49 

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.