And also i have to give the functionality of cut copy paste ...i have the code but its not working inside the Group box or panel... can u modified it .. Private StringBuilder sb=null private void CutCopyPaste(bool Cut, bool Copy, bool Paste) { foreach (Form f in this.MdiChildren) { if (f.ContainsFocus) { foreach (Control c in f.Controls) { if (c.Focused) { if (c.GetType() != typeof(Label)) { if (Cut) { sb.Append(c.Text); c.Text = ""; } else if (Copy) sb.Append(c.Text); else if (Paste) c.Text = sb.ToString(); break; } } } } } } private void copyToolStripMenuItem_Click(object sender, EventArgs e) { try { sb = null; sb = new StringBuilder(); CutCopyPaste(false, true, false); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { try { if (sb != null) CutCopyPaste(false, false, true); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void cutToolStripMenuItem_Click(object sender, EventArgs e) { try { sb = null; sb = new StringBuilder(); CutCopyPaste(true, false, false); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
Rahul DSG
Posts
-
Undo And Select All -
Undo And Select AllAnd for Select All...
-
Undo And Select Alli am developing a c# window application in which i have to give a functionality of Undo And SelectAll.how can we do this i have a MDI parent form and lots of MDI children In MDI parent form.Through MDI parent form i want to control this.
-
Cut,Copy ,Paste Problem...I am trying But its not working...have u run this..
-
Back Up MsSql 2005 Using C# CodeBackUp is Created but Dont Know the format..what format is to adopted by which we can restore it easily..
-
Close MDI Parent FormHow to close a MDI parent Form???
-
Back Up MsSql 2005 Using C# CodeI m developing an application using C#.Net 2005 and MsSql 2005. How to take backup of specific database in MsSql(Using C#) and then how to Restore the backup ...
-
Updating one form through another formsI tried but its not working...
-
Updating one form through another formshow can i use the delegates.tell me in detail or any example...
-
Updating one form through another formsdatagridview having property Public,Private,internal,internalProcted one thing that can be matters is The viewitem form is a MDIChild Form. but the form Additem Is not a MDI form..ok
-
Updating one form through another formsIts not Like that......... datagridview is on a form named ViewItem and we want to update this datgridview through a button that is on another form name AddItem...
-
Updating one form through another formshello... i am developing a C# window based application.i have a form(view Item) that contain a datagridview and a button. datagridview shows the item information and at the button click a new form(Add Item) opened by which user can add the item information. All i need to do is after filling the item information when we click the save button the datagridview must be updated. How can i do this.
-
Cut,Copy ,Paste Problem...how to call this method... processlabel(whichcontrol);
-
Cut,Copy ,Paste Problem...yes u are right...how can i acess those controls that it holds... guide me...
-
Cut,Copy ,Paste Problem...Private StringBuilder sb=null private void CutCopyPaste(bool Cut, bool Copy, bool Paste) { foreach (Form f in this.MdiChildren) { if (f.ContainsFocus) { foreach (Control c in f.Controls) { if (c.Focused) { if (c.GetType() != typeof(Label)) { if (Cut) { sb.Append(c.Text); c.Text = ""; } else if (Copy) sb.Append(c.Text); else if (Paste) c.Text = sb.ToString(); break; } } } } } } private void copyToolStripMenuItem_Click(object sender, EventArgs e) { try { sb = null; sb = new StringBuilder(); CutCopyPaste(false, true, false); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { try { if (sb != null) CutCopyPaste(false, false, true); } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void cutToolStripMenuItem_Click(object sender, EventArgs e) { try { sb = null; sb = new StringBuilder(); CutCopyPaste(true, false, false); } catch (Exception ex) { MessageBox.Show(ex.Message); } } It is the complete code for cut copy and paste but if we take textbox inside the container like groupbox,panel etc. its not working ...and i want also include the feature Undo and SelectAll...how can i do this...
-
Need To Convert Timehello... i am working in a web application .i need to convert the time like... 5.00PM To 1700 6.10PM To 1810 12.00PM TO 2400 etc... if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this... Thanks in Advance
-
Crystal Report Error...I Just make a formula for.... sum({Invoice.Cost} but it gives an error.... A Number filed or currency Amount field is required here.
-
Fill DataSet with two tablesActually I have to make a crystal report which needs two table nothing is common in between these two tables.i tried all these suggestion in this section but not working...i already posted my code...
-
Fill DataSet with two tablesDone All the things but can not Solved ... sda.fill(ds,"Table name Is Must.") Is there any Solution...
-
Fill DataSet with two tablesok... and after what to write... da.fill(ds,"whichtable"); can i write the both table....