|
you have to use Com Interop Services.
Just Check[^]
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
ya i know this .........
and using i can have records in my datagid
.............
now i also want to print all this i dont know how to achieve this
...............
another way I am also trying for crytal reports but not achieved success still
................IS there any other way for doing this .............................
thanks a lot
Thanks & Regards
Manish Singhal
Software Engineer
Maxworth systems(Delhi)
|
|
|
|
|
I am trying to copy a listview's items into an array and make a new array by cloning it. Here is the code which I used
ListViewItem[] tempCollection = new ListViewItem[listView1.Items.Count];
listView1.Items.CopyTo(tempCollection,0);
ListViewItem[] clonedCollection = (ListViewItem[])tempCollection.Clone(); I am getting the tempCollection array filled correctly. But after cloning, clonedCollection array is showing all entries as NULL . What I am doing wrong ?
I have to generate a set of PDF files depending on the items selected on the ListView control. Generation of reports is a long running process - I am using BackGroundWorker and running it on DoWork event. As another thread has no access to the GUI elements, I am doing the cloning. I thought of cloning the ListViewItemCollection and using the cloned array. Is there any better approach for this problem ?
|
|
|
|
|
try this :
ListViewItem[] tempCollection = new ListViewItem[listView1.Items.Count];
listView1.Items.CopyTo(tempCollection,0);
ListViewItem[] clonedCollection = new ListViewItem[listView1.Items.Count];
listView1.Items.CopyTo(clonedCollection,0);
hope it will help
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thanks-but this is not cloning.
|
|
|
|
|
yeah but it will work, i think
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Why do you think that you have to use the Clone method?
Why are you making a clone that you clone, what's wrong with the first array that you create?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Guffa for replying me.
Guffa wrote: Why do you think that you have to use the Clone method?
As you know, another thread won't be able to access the GUI elements. In my case, I have a ListView where user can select the rows and start the process. So I have to check whether the current row is checked in the thread. When I tried to iterate like listview1.Items it threw "cross thread communication error". So I planned to clone the selected items to a new array and iterate on the cloned array.
|
|
|
|
|
hi ,
can any one tell me how to use css in windows applications (C#).
Thanks ,
CSN
|
|
|
|
|
mrsuman wrote: how to use css in windows applications (C#).
Windows applications don't use CSS. It's for web applications.
|
|
|
|
|
I HAVE USED THIS CODE TO ADD FONT TO MY PROJECT:
Code is inside this link:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22687174.html?sfQueryTermInfo=1+%22c+net%22+ad+applic+file+font+ttf[^]
BUT IT SOME TIME GIVE THIS ERROR
System.ArgumentException was unhandled
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.FontFamily.GetName(Int32 language)
at System.Drawing.FontFamily.get_Name()
at System.Windows.Forms.Internal.WindowsFont.FromFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.Internal.WindowsGraphicsCacheManager.GetWindowsFont(Font font, WindowsFontQuality fontQuality)
at System.Windows.Forms.TextRenderer.DrawText(IDeviceContext dc, String text, Font font, Rectangle bounds, Color foreColor, TextFormatFlags flags)
at System.Windows.Forms.Label.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at BarcodeLabelPrinter.Program.Main() in E:\BarcodeLabelPrinter\BarcodeLabelPrinter\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
-------------------------------------------
LINE WHERE THIS ERROR OCCURS
Application.Run(new MainForm());
THIS IS LINE 17 OF PROGRAM.CS
--------------------------------------------
THIS ERROR OCCURS ONLY SOME TIME NOT EVERY TIME WHILE RUNNING APPLICATION....
AND I DID NOT UNDERSTAND THIS ERROR PLEASE HELP ME
|
|
|
|
|
Hello,
this code is with asp.net with VB.Net:
(if items Is nothing then return 0)
but i couldn't write this code with C#.
i'm new to programming...please help me.
thank you.
Hoda
|
|
|
|
|
if (items == null) return 0;
|
|
|
|
|
if(Items==null) return 0;
|
|
|
|
|
Is there a class or method that gets how much memory an object is using? Why I want to is if an object is using more than X ammount of memory, then I'll try to figure out how to make it use less.
Thanks.
|
|
|
|
|
|
CLR Profiler[^] is a very handy program when it comes to memory profiling .NET applications, try it out!
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi guys, In my parent class I have a context menu with 3 times and in the drived class i am adding two more items in the contextmenu. They do get added up and working but what i want is that i want to show drvied class items on the top in the context menu. Is that even possible. Thanks
|
|
|
|
|
|
Hi All,
I'm just creating a Background worker to fill a datatable from an SQLCE database but i'm having trouble then passing that from the DoWork eventEventHandler to the WorkerCompleted event hander on the GUI thread in order to bind it to the datagrid ...
Can anyone advise on that?
TIA,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Use the Result property of DoWorkEventArgs and RunWorkerCompletedEventArgs classes to pass and retrieve result.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Oh my ... thanks very much for this info!!
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Glad to help you
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
I am using the PrintPreviewDialog to display reports created via a class that inherits the PrintDocument. I have no problem displaying the reports, but I would also like to be able to capture any keystrokes the user makes while the preview dialog has the focus; in particular I want to be able to capture the escape key. Unfortunately even though I have added handlers for the PreviewKeyDown, KeyDown, KeyPress, and KeyUp events of the print preview dialog, my class still does not capture any of the keystroke events in the print preview dialog. Does anyone know of a way I can capture keystroke events for the print preview dialog?
Thank you...
|
|
|
|
|
Well, I have an answer to my own question. If anyone is curious, I went ahead and created another class that inherits the PrintPreviewDialog, and by using that class to perform the preview functions I am able to capture keystrokes on the preview form, including escape, from within that class.
I would prefer not to have to create another class but if that is what is needed, I will live.
|
|
|
|