|
|
1.listen the mouse click and move events.
2.Check the method - RotateTransform of Graphic object. E.g.
gfx.RotateTransform(rotationAngle);
I Love KongFu~
|
|
|
|
|
Hi,
I have a DataGridView that displays the UserID and FirstName. I want to change the FirstName to a LinkLabel so that when the user click the firstname a second form will popup with the details of that user.
For example:
When I click test1 it should display the ID and firstname of test1 in form 2.
Can anyone shed some light on this? I have been able to add the linkcolumn but how can I pass the needed variables to retrieve the records?
Thank you!
Illegal Operation
|
|
|
|
|
If you haven't done so already you would want to set your gridview to not auto generate the columns.
Example:
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
Within the GridView declaration, declare a <columns> element.
Within the Columns element, define the <asp:hyperlinkfield> you intend to display, specifying at the very least the required DataTextField and DataNavigateUrlFields properties.
Optionally set the HyperLinkField control's other properties, such as the HeaderText and DataNavigateUrlFormatString. For syntax, see GridView Control Syntax.
Example:
<columns><asp:hyperlinkfield headertext="User" datatextfield="UserName" datanavigateurlfields="UserName" datanavigateurlformatstring="hostmysite.com">
Also you can check out the msdn which provides a lot of helpful information for the gridview. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx[^]
Matthew Vass
QA Analyst
mvass@hostmysite.com
http://www.hostmysite.com?utm_source=bb[^]
|
|
|
|
|
|
Hi
I am attempting to use FileSystemWatcher but get an error at 'OnChange' in the code following.
I've referenced System.IO but there is still something I am missing.
Help would be much appreciated.
Bob
private FileSystemWatcher _fileWatcher;
internal void InitializeWatcher(FileInfo configurationFile, IList<string> configurationSections)
{
_fileWatcher = new FileSystemWatcher
{
Path = "C:\\IDW32\\Library",
Filter = "P&ID.txt",
NotifyFilter = (NotifyFilters.CreationTime | NotifyFilters.LastWrite |
NotifyFilters.FileName)
};
_fileWatcher.Changed += OnChange;
_fileWatcher.EnableRaisingEvents = true;
|
|
|
|
|
An error? What error? They tend to fairly informative so do tell us.
Alan.
|
|
|
|
|
The error message would be most useful, as would the code for the OnChange event handler. Without either there is little we can do to help.
|
|
|
|
|
Sorry
Error message - 'does not exist in the current context'
Bob
|
|
|
|
|
And the code in the OnChange handler? Please also indicate the line of the code where the error occurs - we are not mind readers.
|
|
|
|
|
Hi Colin
I beleive I did indicate the error involved "OnChange" in the expression
_fileWatcher.Changed += OnChange;
Perhaps it wasn't clear.
Here is what I have, so far, for the event handler
public event FileSystemEventHandler Changed;
_sharpMap.RefreshMap();
Bob
|
|
|
|
|
Oh! It is a COMPILER error. It isn't a RUNTIME error in the OnChange method.
Your error is saying that OnChange doesn't exist. You need to create a method called OnChange with the appropriate signature. (i.e. the parameters that the Change event handler is expecting to pass)
Bob Pawley wrote: Here is what I have, so far, for the event handler
public event FileSystemEventHandler Changed;
Doesn't the FileWatcher have events for you to subscribe to? If you create your own then you have to trigger them.
|
|
|
|
|
When you type this line:
_fileWatcher.Changed += OnChange;
You'll find that just after you type the += part that Intellisense offers to complete the line for you (assuming you typed the first part correctly) if you press the tab key. It first of all completes the line and on the second press of tab it will create a method stub for you. That way everything is created and connected up properly very quickly.
|
|
|
|
|
Hi to all,
I am new in this forum. I was searching help about a recent problem i have got with filestream object.
Specifically I have the need that two or more users read and write a file content and so I coded these lines of code:
. . .
. . . this code is in a function.. for simplicity I reported a snippet
public enum dbLockType { _none =0, _lock, _unLock, _default}
long lockPos = -1;
long lockRec = -1;
int blockSize = 100;
FileStream DtFile = new FileStream(@"\\server\d\folder\test.txt", FileMode.Open, FileAccess.ReadWrite,
FileShare.ReadWrite,8000);
. . .
. . .
public bool getBufferFromDisk(long RecordNumber, byte[] toArray, int startingAt, int length, dbLockType dbLock)
{
long seekPosition = GetFilePos(RecordNumber);
try {
DtFile .Seek(seekPosition, System.IO.SeekOrigin.Begin);
DtFile .Read(toArray, startingAt, length);
if ( dbLock == dbLockType._lock) {
if ( lockPos > -1)
DtFile .Unlock(lockPos, blockSize);
DtFile .Lock(seekPosition, blockSize);
lockPos = seekPosition;
lockRec = RecordNumber;
}
}
catch(IOException e) {
return false;
}
return true;
}
After that the first user open the file and call the getBufferFromDisk with these parms:
getBufferFromDisk( 8, toArray, 0, 100, dbLock);
in this way it lock the filestream at pos (7 x100) for 100 bytes.
the second user try to open the file and to execute the same function with these parms:
getBufferFromDisk( 0, toArray, 0, 100, dbLock);
at this point I got an error telling me that the file is partially locked by other process.
I found the prorblem occur at this line :
DtFile .Read(toArray, startingAt, length);
Stange , because I have locked 100 bytes starting from pos 700 not at 0.
After some reading I found this article that seems more like my problem :
So I tried to go further and after some investigation I found :
1. Even though I change the FileAccess to .Read the second user find the record at pos 0 locked.
2. the lock is extended to the whole buffer , that is 8K.
3. all this is true if the second user try to open and read something in this buffer if something in this buffer is locked otherwise all is ok!, I mean if the first user lock something at pos 8500 , 100 the second user has no problem at all.
What is this , a bug? Am I wrong in something ? this is the correct way to lock-unlock regions ?.
Could someone help me to get rid of this problem ?
Thanks to all ?
JossGP
modified on Monday, February 2, 2009 5:01 AM
|
|
|
|
|
|
You might want to edit your post and correct the terminating </pre> so that the remainder of your post word wraps correctly.
|
|
|
|
|
Thank you ,Colin . I didn't see while I was typing.
How I can do that? , I don't see any edit option on bottom's post.
|
|
|
|
|
It is on the bottom right of your post.
|
|
|
|
|
hi i am new in this world..
well if i want to do something by method overloading ,, that can also be done by overloading the constructors & then using the concern method,?
/..
& why we need a delegate??why we need to encapsulate a method in an object??
|
|
|
|
|
waqarnaeem2@hotmail.com wrote: hi i am new in this world..
Welcome to Earth.
waqarnaeem2@hotmail.com wrote: if i want to do something by method overloading ,, that can also be done by overloading the constructors & then using the concern method
|
|
|
|
|
waqarnaeem2@hotmail.com wrote: well if i want to do something by method overloading ,, that can also be done by overloading the constructors & then using the concern method,?
Be confused for this description...
waqarnaeem2@hotmail.com wrote: why we need a delegate??why we need to encapsulate a method in an object??
You can treat delegate as a safe function pointer. Maybe a beginning book is right way to start.
I Love KongFu~
|
|
|
|
|
Hi, i am making a project(an Internet Download Manager) and it has a feature that provided the links it can download videos from youtube, metacafe etc.the project is coded in C#.(I have seen a similar project here in this site but the sol. was not working i had posted question their but got no replies) the problem is i have no idea how can i download the videos from these sites, i.e., what is the method to download the videos. I have searched for it but haven't got any sol. yet and i have submitted the features for the software in the school so can't change it, so please can anyone tell me the method to download the videos from these websites i am not asking for the code just the method, but you have the code it would be great .
Thank you.
|
|
|
|
|
I would have expected a simple HTTP GET would do the trick.. but if that were the case you wouldn't be asking
Maybe you could take a look at the source of Video DownloadHelper (FireFox add-on)[^]
|
|
|
|
|
helu.... does any body know how to obtain local lan ip address of a machine... thans in advance...
|
|
|
|
|
Possibly asking Google [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|