|
In OO and MS Works spreadsheets, when I select a group of cells and then copy them to the clipboard the content is tab-delimited. Is this also the case with Excel? Just a need-to-know type thing and I don't have Excel on my machine.
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Just tried a copy and paste from excel to Notepad and it appears so;
A Cell AN Cell ANO Cell ANOT Cell ANOTH Cell ANOTHE Cell ANOTHER Cell
Dave
Find Me On: Web| Facebook| Twitter| LinkedIn
CPRepWatcher now available as Packaged Chrome Extension, visit my articles for link.
|
|
|
|
|
DaveAuld wrote: Just tried a copy and paste from excel to Notepad and it appears so
Thank You!
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
Yeah, one other thing to watch for in this case... Even if you do not copy contiguous cells you get them all...
IE: If you select a few cells in one row using the control key so you can select individual cells and do a copy and paste you end up with ALL the cells from the first selection to the last.
For example, if you have the numbers 1 through 10 in columns A through J, and you use the CTRL key and select columns B, D and F, then do a copy and paste into notepad you will get all the values from columns B through F, even the ones you didn't select.
Seems odd but that's how it works for some reason.
|
|
|
|
|
Thanks
In this case I was just making sure this was uniform across the major spreadsheet apps for loading delimited text into another program.
Merry Christmas!
Everybody SHUT UP until I finish my coffee...
|
|
|
|
|
I have a form with an ActiveX control on it. When the disconnect event of the OCX runs, I want to close the form. The problem is, if I call the close command from within the disconnect event, I get an access violation as the form/control is disposed of when the OCX event finishes up.
OCX Disconnect Event
{
Custom EventHandler for OCX Disconnect Event
{
Clean up all connections and close form
{
Form Close Event
{
Form is closed and all controls are disposed of
{
}
}
}
}
Exception thrown as the parent form no longer exists
}
I just need to make the Clean up all connections and close form function run after OCX Disconnect Event, but I don't know how or if its possible. Any help or work arounds would be appreciated. Currently, my only work around is basically to leave the parent form open and have the user close it.
|
|
|
|
|
I understand your question like this:
the OCX has to be disconnected at some time;
the Form should be closed when the OCX disconnect has finished.
I know of no perfect solution, this is what I would do:
- when you want to disconnect, close the Form;
- in FormClosing event, tell the OCX to disconnect and wait; if there is no way to get feedback on the disconnect, the wait would be for a fixed time (e.g. 1 sec); if there is a way, a timeout mechanism should also be provided (it would be unacceptable for a Form not to be closing at all).
Hope this helps.
|
|
|
|
|
Guess I forgot to name the type of OCX control. This is an OCX for Remote Desktop/Terminal Services, so the disconnect event if fired whenever they log off, and unfortunetly, I can't capture anything prior to that. I actually do call the disconnect event from the form close, assuming its still connected, and that works. We just prefer to have people log off of there session rather than leaving a disconnected session though.
|
|
|
|
|
Hmm. I guess the event you really want isn't available, so I'd look for a polling scheme then; have a thread or timer periodically try and figure out whether the OCX is still connected, if not, close the Form (or pop up a dialog).
|
|
|
|
|
As an alternative, albeit a messy one; add a timer component to the form, start it from the disconnect, and have the Tick event disable the sender-timer and close the form.
I are Troll
|
|
|
|
|
The Timer method worked great. Thanks for helping me find a work around on this.
|
|
|
|
|
You're welcome
|
|
|
|
|
Is it possible to have a footer row in VB.Net WinForm. I want to total some columns in a data bound datagrid.
|
|
|
|
|
Hi
There's no special "footer"-feature in the standard DataGridView. The easiest way to add it would be by adding a second DataGridView below the first one, showing no headers and containing only a single row.
You might also want to move the summing-calculation to the database, binding the second grid to it's own query in which you collect the SUM for the columns you requested in the first query.
I are Troll
|
|
|
|
|
Thank you shall do that...
|
|
|
|
|
I'd recommend you to create your own control inherited form DataGrid. It should consist of a DataGrid and your footer (you can create it of textboxes, labels, datagrids etc.) I feel it is nice solution, because you can always replace your component with another one implementing your IDataGridWithFootter.
Regards
|
|
|
|
|
Is it possible to host a Winform view inside a user-control ? I can see it is possible in WPF using WindowsFormsHost.
I have a WinForm-view where I have placed a user-control, and on that user-control I want to load a 3rd party WinForm-view dynamically. I'm thinking about issues like resize-/close-/keyboard-events etc.
For more details about my problem see Embedding .NET Winforms in MFC MDI App[^]
modified on Thursday, September 23, 2010 10:03 AM
|
|
|
|
|
Rolf Kristensen wrote: Is it possible to host a Winform view inside a user-control ?
Yes, create the form and add it to the controls-collection[^] of the UserControl[^]. You'd also want to assign the usercontrol to the Parent [^]-property of the form.
Rolf Kristensen wrote: I'm thinking about issues like resize-/close-/keyboard-events etc.
Keys get sent to the form if the form has focus, so in that way it'll behave like a custom control. You can also set the Dock property on the form, automatically resizing it to fit the parent.
I are Troll
|
|
|
|
|
hi
i am using vs.net 2005 c# to create a window form, i would like to ask if it is possible to put a excel form into a window form so i can see the like opening an excel program inside a program and manipulate the excel cells with the program.
please advice, and if possible teach me the name of the method or reference i should find.
|
|
|
|
|
|
Hi,
I have devloped an desktop application in Vb.NET somthing of importing/updating data with SQL server.
App works fine as expected, but when the databse process is going on & if I open any other window then the application shows "Not Responding" on top, part of app window that has components turns white, text/components r not visible or doesn't show update in TextBox BUT the application is running in back & updating the data lying on server.
Due to this I can't know the status of the Import + "Not Responding" on title bar gives the msg that something has gone wrong & an error has occured (but actually no error has occured).
Can anyone tell why does this happen & how to overcome this problem. Any help/guidance is highly appreciated.
Thanks & Regards,
|
|
|
|
|
This usually happens because you have a long running process executing on the UI thread, namely, your database processing. You have to move that processing to a background thread in order to keep the UI responsive and painting itself (the white window goes away).
|
|
|
|
|
Thanks Dave, but the UI is related to DB processing. On updating DB, msg is shown on Textbox, so textbox updating is related to db processing. Then yet, in that case will the threading be useful ?
My code is such :
sub StartProcessing()
' Perform Main
Main_Processing()
' Perform Other
Other_Processing()
' Item Processing
Item_Processing()
return
End sub
sub Main_Processing()
....
....
cmd.Execute("Update .......")
statusTxt.AppendText("Updated document # ...")
end sub
How & where do I add Thread.Run....
Thanks & Regards,
|
|
|
|
|
StartProcessing would launch the thread that executes everything else. Any UI updates (TextBox messages) would have to be Invoke a method on the UI thread that updates the control. Read this article[^]
|
|
|
|
|
Hi Dave,
Learning from the article you provided, I did sme homework. I think I am going somewhere wrong, Can you please check it. Actually have never worked with Threading with .NEt, have worked with Java.
<br />
Private Delegate Sub ControlStringConsumer(ByVal control As Control, ByVal text As String) ' defines a delegate type<br />
<br />
' SetTextData to update text of TextBox (statusTxt)<br />
Private Sub SetTextData(ByVal control As Control, ByVal text As String)<br />
If (control.InvokeRequired) Then<br />
control.Invoke(New ControlStringConsumer(AddressOf SetTextData), New Object() {control, text})<br />
Else<br />
control.Text = text<br />
End If<br />
End Sub<br />
<br />
<br />
' Update Imported<br />
Private Sub updateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updateBtn.Click<br />
If (ValidateInputs()) Then<br />
importAdd = False<br />
' ADDED THREADING EXECUTION FOR Start_Processing<br />
Dim myThreadDelegate As New ThreadStart(AddressOf Start_Processing)<br />
Dim myThread As New Thread(myThreadDelegate)<br />
myThread.Start()<br />
<br />
'Start_Processing()<br />
End If<br />
End Sub<br />
<br />
Private Sub Start_Processing()<br />
'statusTxt.AppendText(vbCrLf + "Initializing...." + vbCrLf + "Loading Data........." + vbCrLf)<br />
dim s as string = vbCrLf + "Initializing...." + vbCrLf + "Loading Data........." + vbCrLf<br />
SetTextData(statusTxt, s)<br />
.........<br />
Endif<br />
<br />
I feel the Threading part is correct - maybe can remove ThreadStart & straight away give AddOf to Thread().
But feel their is somethign wrong with SetTextData. Here I want to AppendText & not only set some new value to it. If this is the right way to do, then everytime I will have to call it as :-
dim s as string = statusTxt.Text + vbcrlf + " MY NEW TExT" + vbcrlf
SetTextData(statusTxt, s)
OR is it so that I should overwrite AppendText instead of SetText & SetText should be used & not SetTextData ????
What do u say, am I going anywher wrong. Don't know why, but this time feeling scared to run without confirmity. Maybe b'coz using Threads. I know how unsafe threads can be if not operated properly.
Thanks & Regards,
|
|
|
|