Click here to Skip to main content
16,004,854 members
Home / Discussions / C#
   

C#

 
QuestionHow to close form with esc key in Datagrid Pin
AndrusM20-Nov-06 8:56
AndrusM20-Nov-06 8:56 
AnswerRe: How to close form with esc key in Datagrid Pin
Eduard Keilholz21-Nov-06 4:03
Eduard Keilholz21-Nov-06 4:03 
GeneralRe: How to close form with esc key in Datagrid Pin
AndrusM21-Nov-06 4:42
AndrusM21-Nov-06 4:42 
QuestionHow to run C# scripts Pin
AndrusM20-Nov-06 8:51
AndrusM20-Nov-06 8:51 
QuestionColoring a line in a RichTextBox control.. Pin
kkadir20-Nov-06 8:39
kkadir20-Nov-06 8:39 
QuestionTo make a size of button changeable by mouse Pin
wasek200120-Nov-06 8:26
wasek200120-Nov-06 8:26 
AnswerRe: To make a size of button changeable by mouse Pin
Christian Graus20-Nov-06 8:53
protectorChristian Graus20-Nov-06 8:53 
AnswerRe: To make a size of button changeable by mouse Pin
Eric Dahlvang20-Nov-06 11:03
Eric Dahlvang20-Nov-06 11:03 
Here's one rather simple and sloppy method for resizing a single button:
using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace CP_CSharp_SizeButton
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && this.Cursor!=Cursors.Default)
            {
                if (this.Cursor==Cursors.SizeWE)
                    button1.Width =  e.X;
                else 
                    button1.Height = e.Y;
            }
            else
            {
                if (e.X > button1.Width-5 && e.X < button1.Width+5)
                    this.Cursor=Cursors.SizeWE;
                else if (e.Y > button1.Height-5 && e.Y < button1.Height+5)
                    this.Cursor=Cursors.SizeNS;
                else 
                    this.Cursor = Cursors.Default;
            }
        }

        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            this.Cursor = Cursors.Default;
        }
    }
}


--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: To make a size of button changeable by mouse Pin
wasek200121-Nov-06 21:12
wasek200121-Nov-06 21:12 
Questionnavigation in a tabbed control (from one tab to another) Pin
Rocky#20-Nov-06 7:48
Rocky#20-Nov-06 7:48 
AnswerRe: navigation in a tabbed control (from one tab to another) Pin
Ravi Bhavnani20-Nov-06 8:31
professionalRavi Bhavnani20-Nov-06 8:31 
GeneralRe: navigation in a tabbed control (from one tab to another) Pin
Rocky#21-Nov-06 3:49
Rocky#21-Nov-06 3:49 
Questionerror identification problem Pin
biaali20-Nov-06 7:13
biaali20-Nov-06 7:13 
AnswerRe: error identification problem Pin
Tal Kain20-Nov-06 14:49
Tal Kain20-Nov-06 14:49 
QuestionValidating a datagrid Pin
Deepasubramanian20-Nov-06 5:58
Deepasubramanian20-Nov-06 5:58 
AnswerRe: Validating a datagrid Pin
Judah Gabriel Himango20-Nov-06 6:02
sponsorJudah Gabriel Himango20-Nov-06 6:02 
AnswerRe: Validating a datagrid Pin
Deepasubramanian20-Nov-06 14:51
Deepasubramanian20-Nov-06 14:51 
QuestionPassing in an array Pin
Muntyness20-Nov-06 5:31
Muntyness20-Nov-06 5:31 
AnswerRe: Passing in an array Pin
LiquidE_SA20-Nov-06 5:35
LiquidE_SA20-Nov-06 5:35 
GeneralRe: Passing in an array Pin
Muntyness20-Nov-06 5:40
Muntyness20-Nov-06 5:40 
GeneralRe: Passing in an array Pin
LiquidE_SA20-Nov-06 5:45
LiquidE_SA20-Nov-06 5:45 
GeneralRe: Passing in an array Pin
Guffa20-Nov-06 6:20
Guffa20-Nov-06 6:20 
GeneralRe: Passing in an array Pin
Muntyness20-Nov-06 6:57
Muntyness20-Nov-06 6:57 
GeneralRe: Passing in an array Pin
Guffa20-Nov-06 7:22
Guffa20-Nov-06 7:22 
AnswerRe: Passing in an array Pin
dbetting20-Nov-06 13:08
dbetting20-Nov-06 13:08 

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.