|
Change your main form, remove the MDI parent.
In your new main form create 4 panels, top, bottom, left and right. Dock them to their edges and either left or right dock to fill. This forms your basic layout.
Copy the content of your MDI forms and paste into the left/right panels. Chuck your MDI forms away (after moving the code as well of course).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Oh, so I was on the right track.
They became hard to manage for me, but they did display correctly using the panel method.
Where do you put the code for the panels, that part was vague to me. I wanted to keep the code organized with the panels.
That's why I reverted back to the MDI forms for now.
|
|
|
|
|
It all lives in the code behind the form or where you decide to organise it. I make heavy use of #regions to make navigating the code easier.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
We have a VB.Net 2010 Windows Desktop app that creates custom invoices for QuickBooks. The app uses the Microsoft.Office.Interop.Word reference.
For each item in the invoice we copy a row or table in Word via
MyTableRowRange.Copy()
and
pRow.Range.Paste()
etc.
Then
Word.Find.Execute(Replace... to change the variables in a Template.Docx file to the real values.
The problem is that it takes too long. Doing 2 invoices with a total of 200 items is taking over 30 minutes on a I3280 quad 3.6 with 8 threads and 16G ram. This is running from a regular exe not from the vs ide.
Any ideas?
|
|
|
|
|
Accordingly to actuall description of issue, using Copy and Paste then Replace function might cause performance issues.
If you want to get more help, please, improve your question and post a bigger part of code.
|
|
|
|
|
The code is scattered in out modules.
Is there a better way of doing the word copy / paste and then replace?
Also every time I paste code into this box the browser hangs up and I loose everything entered include just 1 line (i.e. CodeProject.com not responding).
|
|
|
|
|
Look at doing a mailmerge into the Word document, with the QuickBooks DB as the data source
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
That would not work since much of the data is not in QuickBooks. The Docx Template is also very complex. (We do use mail merge that with other programs when it fits but not with QB as a source but from an extracted file). The program also will save as a PDF and email the invoice once the new Docx file is created.
Really need to know how to speed up what we have currently.
Are certain Word functions just extremely slow? Are there replacements that can be used.
|
|
|
|
|
QuickBooksDev wrote: Are certain Word functions just extremely slow
YES!
It is why Office should never be used in a development environment, that and the versioning nightmare it creates.
Personally I would use a proper reporting tool to generate the invoices. SSRS, Telerik, Dev Express all have excellent reporting tools that will use disparate data sources and produce the most complex output you could require.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It is a bit late to change to something else.
What Word interfaces are extremely slow and what can be done about it?
|
|
|
|
|
Hi Everyone
This is an odd one, so please bare with me. I have a list of players in a football team in a list box. I then have two combo boxes with the same list of players in.
For a player substitute I need to be able to select the player on in one combo box, player off in the other and then switch their names round so player one appears where player two was and vice versa.
To then make it more complex, I need this to be reflected in the combo box.
I tried a very basic:
Dim floatingName = SubOn.SelectedItem
SubOn.SelectedItem = SubOff.SelectedItem
SubOn.SelectedItem = floatingName
but its not as simple as I'd hoped. Also this wouldn't make a difference to the list box.
Can anyone give me some pointers please?
Thanks in advance.
Steve
Slowly learning... if only there was more time in the day!
|
|
|
|
|
You need to remove each player from its ComboBox and then replace them. Just using references as above will not do it.
|
|
|
|
|
How to test The performance Of a Vb.Net Pc Cleaner Software?
|
|
|
|
|
1. Design some tests
2. Run the tests
3. Examine the results
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
You say that like we're supposed to know exactly what this app does and how it does it.
A "cleaner" app can mean anything and do anything.
Your version of "performance" needs to be defined in very specific terms.
|
|
|
|
|
I am using VB.2013.
Code :
Dim MydataStream As Stream = Nothing
MydataStream = MyWebClient.OpenWrite(address:=MySend2URL, method:="POST")
Dim postArray As Byte() = Encoding.ASCII.GetBytes(postData)
MydataStream.Write(postArray, 0, postArray.Length)
MydataStream.Close()
Dim reader As New StreamReader(MydataStream)
How can I get a response that can be used and not the Stream is not readable error.
|
|
|
|
|
Your previous line of code closed the stream, so how do you expect to read it?
|
|
|
|
|
It also happens if I do not close it.
If postData = NIL Then
MydataStream = MyWebClient.OpenRead(address:=MySend2URL)
Else
MydataStream = MyWebClient.OpenWrite(address:=MySend2URL, method:="POST")
MydataStream.Write(postArray, 0, postArray.Length)
End If
Dim ThisResponse As String = NIL
Dim reader As New StreamReader(MydataStream)
|
|
|
|
|
Your stream is opened for write access, or there is nothing to read. You will need to use your debugger to collect more information.
|
|
|
|
|
What information?
I would think that it would be normal to write and expect a response.
|
|
|
|
|
QuickBooksDev wrote: I would think that it would be normal to write and expect a response. Of course, you are correct. But debugging is what we have to do when our applications do not behave normally.
|
|
|
|
|
I understand that I have been coding for many years but I have never used WebClient before and do not know what to look for. I was expecting that is there is some setting or parameter that needs to be set to get the response.
Do you have any explicit things to look for? Or do you have any code that does something similar that you can provide?
|
|
|
|
|
What kind of response are you expecting to get back from the POST? Is it a file? Just a string? Some kind of value? What?
Using (rs = MyDataStream.GetResponse().GetResponseStream())
Using (reader = New StreamReader(rs))
Dim content = reader.ReadToEnd()
End Using
End Using
This might not compile. I'm translating from C# and I'm really tired right now...
|
|
|
|
|
It doesn't compile. Please send c# code. GetResponse is not a member of io stream and rs not defined. How should MyDataStream and rs be defined?
I am not sure of the response. The doc that I have on this service is very limited and not written for .Net.
|
|
|
|
|