Click here to Skip to main content
15,891,657 members
Home / Discussions / C#
   

C#

 
GeneralRe: TypeForwardedToAttribute Pin
Michael Sync26-Jul-07 16:21
Michael Sync26-Jul-07 16:21 
QuestionConverting String to Date Pin
totocaster25-Jul-07 21:01
totocaster25-Jul-07 21:01 
AnswerRe: Converting String to Date Pin
Christian Graus25-Jul-07 21:12
protectorChristian Graus25-Jul-07 21:12 
AnswerRe: Converting String to Date Pin
Vikram A Punathambekar25-Jul-07 22:14
Vikram A Punathambekar25-Jul-07 22:14 
AnswerRe: Converting String to Date Pin
Developer61126-Jul-07 0:32
Developer61126-Jul-07 0:32 
AnswerRe: Converting String to Date Pin
Eliz.k26-Jul-07 22:04
Eliz.k26-Jul-07 22:04 
QuestionFiles restore by MSI after change Pin
Eduard Keilholz25-Jul-07 21:00
Eduard Keilholz25-Jul-07 21:00 
Questiondetecting mouseclick in arraylist Pin
cyn825-Jul-07 20:53
cyn825-Jul-07 20:53 
Hi, i need some help in figuring this out. i have a class as shown below:

public interface IDrawable<br />
	{<br />
		void Draw( Graphics g );<br />
		int CountNo(ArrayList al);<br />
	}<br />
<br />
	public class Ellipse : IDrawable<br />
	{<br />
		public Color c = Color.Black;<br />
		public Point l = new Point(0, 0);<br />
		public Size s = new Size(0, 0);<br />
		public int stroke = 0;<br />
<br />
		public Ellipse( Color c, Point l, Size s, int stroke )<br />
		{<br />
			this.c = c;<br />
			this.l = l;<br />
			this.s = s;<br />
			this.stroke = stroke;<br />
		}<br />
	<br />
		public void Draw( Graphics g )<br />
		{<br />
			g.DrawEllipse( new Pen( c, stroke ), l.X ,l.Y, s.Width,s.Height );<br />
		}

in the form:
<br />
private ArrayList alDrawingObjects = new ArrayList();<br />
.......<br />
alDrawingObjects.Add( new Rect( Color.Black, new Point(pt.X, pt.Y), new Size(50, 50), 5 ) );<br />
alDrawingObjects.Add( new Rect( Color.Black, new Point(pt.X, pt.Y), new Size(50, 50), 5 ) );<br />
.......<br />
private void form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)<br />
		{<br />
			Graphics objGraphics ; <br />
			//You can't modify e.Graphics directly.<br />
			objGraphics = e.Graphics;<br />
			foreach ( IDrawable d in alDrawingObjects )<br />
			{<br />
				d.Draw( objGraphics );<br />
			}<br />
			// Free up resources.<br />
			objGraphics.Dispose();<br />
		}


i need to be able to select with a mouseclick on any of the shape drawn. I thought of using Contain method but i don't know how to implement it. i know that i need to search through the array list and test if the mouseclick point or position is in the drawn shape. may i know how to implement this?

Thank u in advance.
AnswerRe: detecting mouseclick in arraylist Pin
Christian Graus25-Jul-07 21:15
protectorChristian Graus25-Jul-07 21:15 
GeneralRe: detecting mouseclick in arraylist Pin
cyn825-Jul-07 21:40
cyn825-Jul-07 21:40 
Questionto load two combobox side by side on clicking a button(single click). Pin
sowmyasaravanakumar25-Jul-07 20:37
sowmyasaravanakumar25-Jul-07 20:37 
AnswerRe: to load two combobox side by side on clicking a button(single click). Pin
Michael Sync25-Jul-07 20:54
Michael Sync25-Jul-07 20:54 
GeneralRe: to load two combobox side by side on clicking a button(single click). Pin
Michael Sync25-Jul-07 20:57
Michael Sync25-Jul-07 20:57 
QuestionEnable/Disable Menuitems of MdiParent from MdiChild Pin
zenithmaximus25-Jul-07 20:14
zenithmaximus25-Jul-07 20:14 
AnswerRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
ashukasama25-Jul-07 20:54
ashukasama25-Jul-07 20:54 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
zenithmaximus25-Jul-07 21:06
zenithmaximus25-Jul-07 21:06 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
ashukasama25-Jul-07 21:11
ashukasama25-Jul-07 21:11 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
zenithmaximus25-Jul-07 21:20
zenithmaximus25-Jul-07 21:20 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
ashukasama25-Jul-07 22:05
ashukasama25-Jul-07 22:05 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
zenithmaximus25-Jul-07 22:21
zenithmaximus25-Jul-07 22:21 
GeneralRe: Enable/Disable Menuitems of MdiParent from MdiChild Pin
ashukasama25-Jul-07 22:26
ashukasama25-Jul-07 22:26 
Questionexport data from datagrid to excel sheet Pin
srinivassam25-Jul-07 19:52
srinivassam25-Jul-07 19:52 
AnswerRe: export data from datagrid to excel sheet Pin
zenithmaximus25-Jul-07 20:22
zenithmaximus25-Jul-07 20:22 
GeneralRe: export data from datagrid to excel sheet Pin
srinivassam25-Jul-07 20:32
srinivassam25-Jul-07 20:32 
GeneralRe: export data from datagrid to excel sheet Pin
zenithmaximus25-Jul-07 20:58
zenithmaximus25-Jul-07 20:58 

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.