|
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.
|
|
|
|
|
Hi,
Any points will be greatly appreciated.
Code shippet, etc..
Thanks.
|
|
|
|
|
There isn't too much to it. Here is a small sample class. It should be named something like WebServiceListner.asmx
Hope this gets you started.
Hogan
<br />
using System;<br />
using System.Data;<br />
using System.Web;<br />
using System.Collections;<br />
using System.Web.Services;<br />
using System.Web.Services.Protocols;<br />
using System.ComponentModel;<br />
<br />
public class Class1<br />
{<br />
[WebService(Namespace = "http://your.url.here.com/")]<br />
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />
[ToolboxItem(false)]<br />
public class Class1: System.Web.Services.WebService<br />
{<br />
[WebMethod]<br />
public string WebServiceMethod(string xmlData)<br />
{<br />
return "";<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Thank you.
That is exactly what I had in mind.
|
|
|
|
|
hello
can i set the location of the open/Save filedialog box
best regards
dghdfghdfghdfghdgh
|
|
|
|
|
Yes you can. Use the InitialDirectory property.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
hello
hey i mean the place of the dialog in the screen
10x
dghdfghdfghdfghdgh
|
|
|
|
|