|
Hi Pete O'Hanlon,
Thank you for your reply. I thought of writing a program for it. Your reply made my life easier. I will try it.
~Javid
|
|
|
|
|
I have Winforms MDI application where forms contain TextBoxes and
DataGridViews.
Edit menu DropDownOpening contains:
private void editToolStripMenuItem_DropDownOpening(object sender, EventArgs
e) {
pasteToolStripMenuItem.Enabled = Clipboard.ContainsText();
}
DropDownOpening event does not fire.
Why ?
How to implement Edit / Copy, Paste, Cut items ?
Andrus.
Andrus
|
|
|
|
|
AndrusM wrote: DropDownOpening event does not fire.
Why ?
Impossible to say, we can't see where you hook it up, or when you expect it to fire.
AndrusM wrote: How to implement Edit / Copy, Paste, Cut items ?
Depends entirely on the data you want to cut/copy/paste, but mostly you move it between the clipboard and your application.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hey guyz how can i delete the temporary file that i created, whenever i retrieved the image saved in my database.. it keeps on growing..i hope u can help me regarding these...
here is the code
string strfn = Convert.ToString(DateTime.Now.ToFileTime());
FileStream fs=new FileStream(strfn,FileMode.CreateNew,FileAccess.Write);
fs.Write(imageByte,0,imageByte.Length);
fs.Flush();
fs.Close();
picBox.Image = Image.FromFile(strfn);
|
|
|
|
|
System.IO.File.Delete(...)
|
|
|
|
|
Hi,
FromFile keeps the file locked.
Replace the last line picBox.Image = Image.FromFile(strfn); by the following (approx):
Bitmap bm = Image.FromFile(strfn);
picBox.Image=new Bitmap(bm);
bm.Dispose();
File.Delete(strfn);
|
|
|
|
|
Could you not use a MemoryStream and Image.FromStream?
|
|
|
|
|
Consider my code below
Cursor m_OldCursor;<br />
void OnCursorChanged(object sender, EventArgs e)<br />
{<br />
if(m_OldCursor != null)<br />
{<br />
m_OldCursor.Dispose();<br />
}<br />
m_OldCursor = new Cursor(this.Cursor.CopyHandle());<br />
}<br />
<br />
void ProcessMouseMove(EventArgs e)<br />
{<br />
}
I know it is wrong to use a object after it is disposed. but every single
time the CopyHandle() method is invoked, it creates a handle. since there
is a restriction on the number of handles that windows can manage, i need
to dispose this handle after its use. if not then the application will
crash. If instead of Cursor, it was a control then i could have used the DestroyHandle property.
Could you suggest me any other way to do the same.
thanks in advance.
Keshav Kamat
India
|
|
|
|
|
Hi,
two comments:
1.
you should not try to dispose of cursors that you did not create yourself;
that's every Cursor you get from the Cursors class (the system created those, it
will dispose of them too when appropriate, and maybe never !)
2.
who is changing the cursor ? cant you do that with a simple method, something like (inside
your form class):
public static void SetCursor(Cursor newCursor) {
Cursor oldCursor=Cursor;
Cursor=newCursor;
oldCursor.Dispose();
}
no handles involved !
Hope this helps.
|
|
|
|
|
How to create pdf file from reading the data from the dataset and directly convert to the pdf file.
|
|
|
|
|
iTextSharp is a free .NET PDF extension. But even with it, writing pdf files in .NET is not very easy. There are some articles here on CP about iTextSharp, and also other free libraries, but most of them with limited functionality.
Search the "Articles" section.
GL!
|
|
|
|
|
Try CrystalReports... For creating PDF's its easy
|
|
|
|
|
hi all,
In my application iam using datagrid ,in that i want to do navigation but my code is not reflecting .and also i want to edit the row , how to do this
<pre>
private void DataGrid1_PageIndexChanged(object source,System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex =e.NewPageIndex ;
//DataGrid1.CurrentPageIndex = e.NewPageIndex;
String connection = "uid=sa; password=sa123; database=usermanagement; server=c113";
SqlConnection con= new SqlConnection (connection);
//SqlCommand cmd=new SqlCommand ("select * from tbl_user_management
SqlDataAdapter da=new SqlDataAdapter ("select * from tbl_user_management",con);
con.Open ();
DataSet ds=new DataSet ();
da .Fill (ds ,"tbl_user_management");
DataGrid1 .DataSource =ds.Tables[0];// ("tbl_user_management");
DataGrid1 .DataBind ();
con.Close ();
}
<pre>
srinivas
|
|
|
|
|
Have you enabled Paging property in Properties?
|
|
|
|
|
|
I really dont have any exp. in web development,
but have some knowledge abt building web pages in asp.net,
I want to know what is difference between web pages which r developed by asp.net and flash player?
|
|
|
|
|
You can't use flash to create web pages. When you create a "web page" in flash, it's just a flash movie that you show as an embedded element in a web page.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hai Everybody,
I want to queue some events in the message queue and it has to be retained even though the system is restarted. I have created a message queue as follows but it is not retaining the messages can any one give a solution to this please it is very very important and urgent.
<br />
private System.Messaging.MessageQueue eventMessageQueue;<br />
if (!System.Messaging.MessageQueue.Exists(System.Net.Dns.GetHostName() + @"\EM"))<br />
{<br />
try<br />
{<br />
eventMessageQueue = System.Messaging.MessageQueue.Create(System.Net.Dns.GetHostName() + @"\EM",true);<br />
}<br />
catch (System.Messaging.MessageQueueException messagingException)<br />
{<br />
schedulerClass.LogError(messagingException, "Scheduler Error", EventLogEntryType.Error);<br />
}<br />
catch (Exception generalException)<br />
{<br />
schedulerClass.LogError(generalException, "Scheduler Error", EventLogEntryType.Error);<br />
}<br />
}<br />
else<br />
{<br />
eventMessageQueue = new MessageQueue(System.Net.Dns.GetHostName() + @"\EM");<br />
}<br />
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
hi,
May i know how to allow shapes drawn(e.g using DrawRectangle) on a window form to be drag and drop to a user control dock on the left side of the form? Can somebody explain briefly the step to do it? So Any help is much appreciated.
Thanks
|
|
|
|
|
Hi all
I cannot match between thread and process. Need to kill a cirtain thread, I know in general to what module the thread belongs but cannot distinct between the diffrent threads. all I get is a list of the threads ID that belong to my process....
|
|
|
|
|
Killing a thread is a bad idea in almost all cases. It can destabilise the entire process.
Steve
|
|
|
|
|
I know...... I have no choise. It's not my module.......
|
|
|
|
|
OK then, but it will end in tears!
Steve
|
|
|
|
|
Can I, at least, configure to what modoule does a cirtin thread belongs to?
|
|
|
|
|
No I dont think so.
AFAIK the managed threads are virtual, i.e. they are not even guaranteed to correspond to
a physical (i.e. a Windows kernel) thread.
This is somewhat illustrated by the fact that managed threads have a ManagedThreadId property,
whose value does not correspond to the kernel's thread IDs; and it has a name, for which
the kernel has no equivalent member at all.
In my experience, there still is a 1-to-1 correspondence between a managed thread and a
kernel thread, but I havent found any way to map them, other than having each managed thread
call some native code to get its own kernel thread ID that is.
Hope this clarifies things a bit.
|
|
|
|