Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
QuestionStrange Dataset problem! [modified] Pin
Muammar©20-Jun-09 22:39
Muammar©20-Jun-09 22:39 
AnswerRe: Strange Dataset problem! Pin
Mycroft Holmes20-Jun-09 23:15
professionalMycroft Holmes20-Jun-09 23:15 
AnswerSolved! Pin
Muammar©20-Jun-09 23:24
Muammar©20-Jun-09 23:24 
QuestionGDI+, problem with Invalidate() method Pin
cppwxwidgetsss20-Jun-09 21:16
cppwxwidgetsss20-Jun-09 21:16 
AnswerRe: GDI+, problem with Invalidate() method Pin
Christian Graus21-Jun-09 0:37
protectorChristian Graus21-Jun-09 0:37 
AnswerRe: GDI+, problem with Invalidate() method Pin
OriginalGriff21-Jun-09 0:50
mveOriginalGriff21-Jun-09 0:50 
Questionautocomplete selection Pin
Iain Wiseman20-Jun-09 19:33
Iain Wiseman20-Jun-09 19:33 
AnswerRe: autocomplete selection Pin
dan!sh 20-Jun-09 21:42
professional dan!sh 20-Jun-09 21:42 
GeneralRe: autocomplete selection Pin
Iain Wiseman20-Jun-09 22:43
Iain Wiseman20-Jun-09 22:43 
GeneralRe: autocomplete selection Pin
dan!sh 20-Jun-09 23:19
professional dan!sh 20-Jun-09 23:19 
GeneralRe: autocomplete selection Pin
Iain Wiseman21-Jun-09 11:17
Iain Wiseman21-Jun-09 11:17 
QuestionGet PropertyGrid to update? Pin
FocusedWolf20-Jun-09 19:01
FocusedWolf20-Jun-09 19:01 
AnswerRe: Get PropertyGrid to update? Pin
dan!sh 20-Jun-09 23:55
professional dan!sh 20-Jun-09 23:55 
GeneralRe: Get PropertyGrid to update? Pin
FocusedWolf21-Jun-09 9:09
FocusedWolf21-Jun-09 9:09 
GeneralRe: Get PropertyGrid to update? Pin
FocusedWolf21-Jun-09 9:16
FocusedWolf21-Jun-09 9:16 
GeneralRe: Get PropertyGrid to update? Pin
dan!sh 21-Jun-09 16:46
professional dan!sh 21-Jun-09 16:46 
GeneralRe: Get PropertyGrid to update? Pin
FocusedWolf21-Jun-09 19:08
FocusedWolf21-Jun-09 19:08 
GeneralFocus losing in propertygrid Pin
VB 8.07-Jul-09 23:41
VB 8.07-Jul-09 23:41 
QuestionDatagridview combobox in column header Pin
desir10220-Jun-09 13:39
desir10220-Jun-09 13:39 
AnswerRe: Datagridview combobox in column header Pin
MarkB77720-Jun-09 17:40
MarkB77720-Jun-09 17:40 
AnswerRe: Datagridview combobox in column header Pin
Manas Bhardwaj20-Jun-09 21:33
professionalManas Bhardwaj20-Jun-09 21:33 
QuestionRemote desktop shown to another client? Pin
Member 465319820-Jun-09 12:38
Member 465319820-Jun-09 12:38 
QuestionExcel like Selection? Pin
Megidolaon20-Jun-09 12:21
Megidolaon20-Jun-09 12:21 
I might have asked this before, but I never got any good answer.

How do I implement an excel like selection?

I have a collection of many controls arranged in lines and rows, much like excel cells.
The user i supposed to select them like cells in Excel, but it just won't work.

The controls' MouseDown and MouseEnter event apparently cause the control to own the mouse and make it impossible to fire events on any other control as long as the mouse button is held down.

I also got this code on msdn, but it's utter rubbish. It will cause a single control to flicker between selected and unselected madly, it's not possible to select multiple controls and the control isn't drawn while you hold the mouse over it.
Point start;
		private void pictureBox_MouseDown(object sender, MouseEventArgs e)
		{
			start = e.Location;
		}

		private void pictureBox_MouseMove(object sender, MouseEventArgs e)
		{
			if (e.Button == MouseButtons.Left)
			{
				Size selSize=new Size(e.X - start.X, e.Y - start.Y);
				Rectangle selRect = new Rectangle(start, selSize);
				selRect.Offset(((Control)sender).Location);
				foreach (Control ctl in this.flowLayoutPanel1.Controls)
				{
					if (ctl.Bounds.IntersectsWith(selRect))
					{
						// Here goes your code for doing whatever you need to "select"
						// the picture box...

						ctl.BackColor = Color.Yellow;
					}
					else
					{
						// Here goes your code for doing whatever you need to "deselect"
						// the picture box...

						ctl.BackColor = Color.Gray;
					}
				}
			}
		}
So, does anyone have a solution or at least a hint?

Tanks a lot!
AnswerRe: Excel like Selection? Pin
Christian Graus20-Jun-09 12:47
protectorChristian Graus20-Jun-09 12:47 
Question?How add a database to my c# project? Pin
H.R(Hamid reza)20-Jun-09 11:12
H.R(Hamid reza)20-Jun-09 11:12 

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.