|
|
Does anyone know how to get a client point from a mouse click?
I have a drag drop event
void pnlMap_DragDrop(object sender, DragEventArgs e)
in which it returns the point in screen coordinates. Is there a method that I can pass in a screen point and get a client Point?
And is there a function I can call that will get the client rectangle for a title border on a form?
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Control.PointToClient [from this. to Control.]
Control.PointToScreen
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
-- modified at 12:24 Tuesday 18th July, 2006
|
|
|
|
|
thanks. your a great help
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Is there a way to do this without having to close/reopen the stream? When updating a file, I want to have FileShare.None set to avoid potential problems with partial data being read, after the write is complete I want to switch to FileShare.Read. The close/reopen route would run a risk of annother user grabbing the file between the two calls.
|
|
|
|
|
I would recommned closing them as often as possible. Your application should gracefully handle the event of another user "grabbing" the file.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
if anything, the app should be using a DB backend instead of trying to kluge concurrency into flatfiles, but that's a seperate issue entirely, and not something that's changable.
|
|
|
|
|
And NT Security to disable other users from obtaining anything but read access to the file.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
What should I be plugging into google, I'm not having any luck finding anything relevant to development as opposed to a sysadmin locking a box down. Also, will it work properly over samba at all? Samba doesn't provide support for all the win32 FS calls. The API behind the FileSystemWatcher isn't done at all, and the api it replaced is missing parts, from a samba devlist I managed to find that the limitations were due to the inability to get acceptable performance without running large parts of samba as kernel level code.
|
|
|
|
|
Sometimes systems are designed, from the ground up, not to be maintainable or flexible. I am sure there is a way but it seems to me like it would be a hack. You can always maintain a temp file with read/write and the actual file with read write. Write to the temp file and the truncate the real file with the temp.
(This whole issue seems like it came from the history of modern databases )
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: (This whole issue seems like it came from the history of modern databases )
Yeah, it's really given me an insight into why the first db systems were invented. Given the other constraints and the fact that in normal operation there'd only ever be a single user I can understand why the decision was made, but covering the exceptional case's is proving to be very unpleasant as well.
|
|
|
|
|
You now have fodder for your first article?
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
...if I could figure out how to write it without discussing anything proprietary or covered under the corperate IP policy, maybe. I don't see how to do that and have anything meaningful though so probably not.
|
|
|
|
|
I need to set all the pixels to one default color in a bitmap.
Is there to do a BitBlt function?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Paint a Filled Rectangle over the region of the entire bitmap.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Yeah I just did that.
Do you know if GDI+ has a BitBlt'ing function?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
|
Does anyone know of any obsfuscator for c#?
i tried finding in google but failed
Thanks
|
|
|
|
|
Well if you spell it correctly you'll probably get further
obfuscator[^]
|
|
|
|
|
Ok, I have this RichTextBox. I know that the underlying control has built-in handling of clipboard shortcut keys (CTRL+C/V/X). However, it doesn't paste images copied to the clipboard (using CTRL+V). I'm aware of using the Paste(DataFormats.Format) function to paste an image. When I try to use that (with a custom Paste button on a nearby toolbar) it works fine, with either images or text. However, the shortcut key doesn't do that. The shortcut key only pastes text. I've noticed that RichTextBox has no OnPaste to override, and there's no Paste event to handle. How can I get the RichTextBox to paste a copied image using the shortcut key ?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I tried handling the keystrokes in KeyDown and setting the KeyEventArgs.Handled in the KeyPress handler to true, but it passed the keystrokes on to the underlying control anyway (basically pasted text twice).
...I suppose I could just check for the image dataformat, and igore the data otherwise (passing text to the underlying control to paste, considering the underlying control doesn't paste image data by iteself)... I'll give that a try...
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I got it to function almost completely perfectly (by setting the KeyEventArgs.SuppressKeyPress to true for CTRL+V and pasting manually). However, I've run into a different problem with copying. I'll start a different thread (since it's not really related).
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hi guys I am getting an "Object reference not set to an instance of an object" error when I try to pass the value from a windows form to a class file.
Here is the code I have in my windows form:
public int validatecheckbox()
{
if(checkBoxPosted.Checked==true)
{
return 1;
}
else
{
return 0;
}
}
Here is the code in my class file:
Int32 nOne=1;
Process.ProcessFile obj=null;
obj=new Process.ProcessFile();
nOne=obj.validatecheckbox();
Please help!!
sasa
|
|
|
|
|
|
I am sorry I am a newbie in C#. If I try to call validatecheckbox function from another function in the windows form than it passes the value but it doesn't do so when I try to call it from the class file.
Please help.
sasa
|
|
|
|