Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
Generalusing windows' auto complete Pin
Green Fuze31-May-05 8:43
Green Fuze31-May-05 8:43 
GeneralRe: using windows' auto complete Pin
OMalleyW31-May-05 9:00
OMalleyW31-May-05 9:00 
GeneralRe: using windows' auto complete Pin
Green Fuze31-May-05 12:35
Green Fuze31-May-05 12:35 
QuestionVideo Buffer? Pin
OMalleyW31-May-05 8:13
OMalleyW31-May-05 8:13 
AnswerRe: Video Buffer? Pin
OMalleyW1-Jun-05 7:16
OMalleyW1-Jun-05 7:16 
GeneralLooking for MS Word AutoShape like Toolbar Pin
Don Ashworth31-May-05 7:56
Don Ashworth31-May-05 7:56 
GeneralOdbcDataReader!! Pin
trk_wakil31-May-05 7:34
trk_wakil31-May-05 7:34 
GeneralRe: OdbcDataReader!! Pin
KaptinKrunch31-May-05 19:47
KaptinKrunch31-May-05 19:47 
GeneralRe: OdbcDataReader!! Pin
trk_wakil1-Jun-05 1:08
trk_wakil1-Jun-05 1:08 
Generalneed client-based component for use in web pages Pin
ctlajoie31-May-05 6:54
ctlajoie31-May-05 6:54 
QuestionProcessStartInfo.Arguments - No Spaces in Path? Pin
pgaribay521131-May-05 6:46
pgaribay521131-May-05 6:46 
AnswerRe: ProcessStartInfo.Arguments - No Spaces in Path? Pin
r_u_i_z_m31-May-05 7:06
r_u_i_z_m31-May-05 7:06 
AnswerRe: ProcessStartInfo.Arguments - No Spaces in Path? Pin
S. Senthil Kumar31-May-05 7:13
S. Senthil Kumar31-May-05 7:13 
GeneralVS 2005 Beta Pin
Alex_Y31-May-05 5:33
Alex_Y31-May-05 5:33 
Generalidentifying Partial type by using reflecton Pin
rathishps31-May-05 5:14
rathishps31-May-05 5:14 
GeneralRe: identifying Partial type by using reflecton Pin
S. Senthil Kumar31-May-05 5:59
S. Senthil Kumar31-May-05 5:59 
GeneralTypeConverter on Array Property Pin
ChrisAdams31-May-05 4:12
ChrisAdams31-May-05 4:12 
QuestionHow to open a file using windows API? Pin
Anonymous31-May-05 2:16
Anonymous31-May-05 2:16 
AnswerRe: How to open a file using windows API? Pin
darthWesley31-May-05 5:27
sussdarthWesley31-May-05 5:27 
AnswerRe: How to open a file using windows API? Pin
nemopeti31-May-05 23:23
nemopeti31-May-05 23:23 
AnswerRe: How to open a file using windows API? Pin
Anonymous31-May-05 23:27
Anonymous31-May-05 23:27 
AnswerRe: How to open a file using windows API? Pin
Anonymous31-May-05 23:39
Anonymous31-May-05 23:39 
Generalfind registry if modem connected Pin
ksanju100031-May-05 2:10
ksanju100031-May-05 2:10 
GeneralProgramatically moving a borderless form Pin
darthWes31-May-05 1:52
darthWes31-May-05 1:52 
GeneralRe: Programatically moving a borderless form Pin
rudy.net31-May-05 5:14
rudy.net31-May-05 5:14 
Wes, you have to use a fixed coordinate system because the form's coordinate keeps changing as it moves, so you should use the Screen coordinates.
Here is the code: (Try using entire form instead of panel to see if painting still works fine)
<br />
		private Point lastPos, offset;<br />
		private bool movingMe;<br />
<br />
		private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)<br />
		{<br />
			//Get the position of the top left corner of the form<br />
			Size zeroCoordinate = (Size)PointToScreen(new Point(-2,-30));<br />
			//Store the offset from top left corner to the current mouse position<br />
			Point mousePos = PointToScreen(new Point(e.X, e.Y));<br />
			offset = mousePos - zeroCoordinate;<br />
			movingMe = true;<br />
		}<br />
		private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)<br />
		{<br />
			if(movingMe)<br />
			{<br />
				int dX, dY;<br />
				Point mousePos = PointToScreen(new Point(e.X, e.Y));<br />
				dX=mousePos.X - lastPos.X;<br />
				dY=mousePos.Y - lastPos.Y;<br />
				if(dX != 0 || dY != 0)<br />
				{<br />
					this.Location = mousePos - (Size)offset;<br />
					this.Refresh();<br />
					lastPos = mousePos;<br />
				}<br />
			}<br />
<br />
		}<br />
		private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)<br />
		{<br />
			movingMe = false;<br />
		}<br />
<br />
This was an interesting problem, please let me know of any additional updates you make so I can add your changes to my code snippets.

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.