Click here to Skip to main content
15,915,745 members
Home / Discussions / C#
   

C#

 
GeneralRe: Administrative system of parking tower Pin
David Crow15-Jun-06 5:41
David Crow15-Jun-06 5:41 
AnswerRe: Administrative system of parking tower Pin
Josh Smith14-Jun-06 8:33
Josh Smith14-Jun-06 8:33 
AnswerRe: Administrative system of parking tower Pin
Dan Neely14-Jun-06 9:30
Dan Neely14-Jun-06 9:30 
GeneralRe: Administrative system of parking tower Pin
Josh Smith14-Jun-06 9:49
Josh Smith14-Jun-06 9:49 
QuestionNat Traversal Problem Pin
snouto14-Jun-06 8:11
snouto14-Jun-06 8:11 
AnswerRe: Nat Traversal Problem Pin
leppie14-Jun-06 23:47
leppie14-Jun-06 23:47 
GeneralRe: Nat Traversal Problem Pin
snouto15-Jun-06 0:26
snouto15-Jun-06 0:26 
QuestionCopy & Paste Problems in Win Forms Pin
gruszkad14-Jun-06 7:24
gruszkad14-Jun-06 7:24 
I'm doing development for a C# Windows Forms application. Currently, users are complaining of copy and paste problems on multiple forms. People are unable to copy and paste in some or all areas of the forms. It either throws an exception (see below) or the copy/paste box is grayed out.

System.Threading.ThreadStateException: The current thread must set to Single Thread Apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
at System.Windows.Forms.Clipboard.GetDataObject()
at C1.Win.C1Input.C1TextBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


I have researched this alot and it seems to be some sort of Windows threading issue. The application is run via No Touch Deployment, which I think defaults to Multi Threaded Apartment, even if you start the app on a STA thread. I have a solution for the copying but I need to know how to hook it up to the Copy / Paste event in Windows forms....Is there a way you can override the Copy and Paste functions in a windows form? For example when you right click on a textbox and choose copy from that little context menu, Can I handle that click event on that menu some how? Could I override the Ctrl C key down call and hook up my own copy??????

This would be of MUCH help!!! Thanks guysBig Grin | :-D Big Grin | :-D Big Grin | :-D

Daniel Gruszka
QuestionDataGridView Refresh Problems Pin
Melon0014-Jun-06 6:21
Melon0014-Jun-06 6:21 
AnswerRe: DataGridView Refresh Problems Pin
Mr. VB.NET14-Jun-06 7:14
Mr. VB.NET14-Jun-06 7:14 
GeneralRe: DataGridView Refresh Problems Pin
Office Lineman14-Jun-06 7:26
Office Lineman14-Jun-06 7:26 
QuestionShutdown Computer Through C Program. Pin
Droze14-Jun-06 6:14
Droze14-Jun-06 6:14 
AnswerRe: Shutdown Computer Through C Program. Pin
Jun Du14-Jun-06 7:04
Jun Du14-Jun-06 7:04 
GeneralRe: Shutdown Computer Through C Program. Pin
Droze14-Jun-06 7:24
Droze14-Jun-06 7:24 
GeneralRe: Shutdown Computer Through C Program. Pin
Jun Du14-Jun-06 7:28
Jun Du14-Jun-06 7:28 
GeneralRe: Shutdown Computer Through C Program. Pin
Droze14-Jun-06 7:46
Droze14-Jun-06 7:46 
GeneralRe: Shutdown Computer Through C Program. Pin
Droze14-Jun-06 8:06
Droze14-Jun-06 8:06 
GeneralRe: Shutdown Computer Through C Program. Pin
Dan Neely14-Jun-06 9:21
Dan Neely14-Jun-06 9:21 
AnswerRe: Shutdown Computer Through C Program. Pin
Droze14-Jun-06 9:32
Droze14-Jun-06 9:32 
AnswerRe: Shutdown Computer Through C Program. Pin
Koushik Biswas15-Jun-06 10:36
Koushik Biswas15-Jun-06 10:36 
QuestionReporting Service install problem... Pin
ersinsivaz14-Jun-06 6:01
ersinsivaz14-Jun-06 6:01 
AnswerRe: Reporting Service install problem... Pin
Suamal14-Jun-06 19:15
Suamal14-Jun-06 19:15 
QuestionRunning parallely single Application with two differnt versions Pin
kumar.bs14-Jun-06 5:59
kumar.bs14-Jun-06 5:59 
AnswerRe: Running parallely single Application with two differnt versions Pin
Mr. VB.NET14-Jun-06 6:10
Mr. VB.NET14-Jun-06 6:10 
GeneralRe: Running parallely single Application with two differnt versions Pin
kumar.bs14-Jun-06 6:17
kumar.bs14-Jun-06 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.