| | |
context menu and print preview problem
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
hi
I have two forms, form 1 has list1 and form 2 has list 2.
I need to use one context menu (cmenu)which is work in form 1 and it must be in work form 2 too the same context menu.. but there is a problem with Print Preview which is an item in the context menu when I right click in list 2 I see the items of list 1 in the print preview page.
how can I fix it??? first let me tell you what I did.
to make the context menu work in form 2 I wrote this:
Code:
in the print preview context menu item code:
Code:
it prints list1 when I click form1 or form2.
how can I make PrintPreviewDialog1.document = PrintDialog2 'to print list2 ??
I can't access the code to change the document according the source of right click if it was list1 to do this or if it was list2 to print the other document.
I tried to use class but I had problems too
thanks
I have two forms, form 1 has list1 and form 2 has list 2.
I need to use one context menu (cmenu)which is work in form 1 and it must be in work form 2 too the same context menu.. but there is a problem with Print Preview which is an item in the context menu when I right click in list 2 I see the items of list 1 in the print preview page.
how can I fix it??? first let me tell you what I did.
to make the context menu work in form 2 I wrote this:
Code:
VB.NET Syntax (Toggle Plain Text)
form2.show() form2.list2.ContextMenuStrip= form1.cmenu
in the print preview context menu item code:
Code:
VB.NET Syntax (Toggle Plain Text)
PrintPreviewDialog1.document = PrintDialog1 'PrintDialog1 has a loop to print items of list1 in form1 PrintPreviewDialog1.ShowDialog()
how can I make PrintPreviewDialog1.document = PrintDialog2 'to print list2 ??
I can't access the code to change the document according the source of right click if it was list1 to do this or if it was list2 to print the other document.
I tried to use class but I had problems too
thanks
It seems that
I didn't fully test this but it should be very easy to do:
form2.list2.ContextMenuStrip references to the list in form1. Create a copy of the form1.cmenu I didn't fully test this but it should be very easy to do:
VB.NET Syntax (Toggle Plain Text)
Dim ArrItems() As ToolStripMenuItem ReDim ArrItems(form1.cmenu.Items.Count - 1) form1.cmenu.Items.CopyTo(ArrItems, 0) form2.list2.ContextMenuStrip.Items.AddRange(ArrItems)
Teme64 @ Windows Developer Blog
Hi! Nice to hear that you got answer to your problem, could you please mark the thread as solved. Thank you!
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Hey crunchie, RE: LOP problem (Viruses, Spyware and other Nasties)
- HiJack This Log - xod.dll problem (Viruses, Spyware and other Nasties)
- another hacktool.rootkit problem! (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: I could use some help!
- Next Thread: C++ codes with vb.net
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net 30minutes 2005 2008 access account application arithmetic array arrays basic binary bing button buttons c# center check checkbox code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dropdownlist excel file-dialog folder ftp generatetags google gridview hardcopy image images inline insert intel internet listview mobile monitor ms net networking output passingparameters peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save searchbox searchvb.net select serial server soap sorting table tcp text textbox timer toolbox trim update updown user vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






it worked