|
I have a project that dynamically displays the selected form/control in another Forms splitContainer panels, either left or right etc.
Problem I had when running this code was that the form/control within the splitContainer doesn't resize and get's cut-off when the main app resizes. This I fixed by calling the .Show() of the internal Form, BEFORE adding it to the splitContainer, now it resizes just fine! But since the control is being shown before it's done generating, it creates a flicker effect in which you can see for a millisecond how the controls are generated and placed, and it doesn't look very professional.
This was a mouthful, but if you understand where I'm coming from, and maybe know where I should go, please let me know!
I'd also like to mention that the Form containing the splitContainer is itself located within an MDI Parent.
Regards!
|
|
|
|
|
Try turning on double buffering for the form.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
I used to build databases with MS Access and I need to learn SQL server 2008
what books do you recommend for SQL server 2008
|
|
|
|
|
|
hi,
how i can catch the processes of other types rather than .exe and .dll using c#?
Process[] p=Process.getprocesses();//return only .exe and .dll files
|
|
|
|
|
I don't understand, those are the processes that are running, what do you see differently when you press crtl-alt-del?
Other files, .doc, .jpg, .cs have an association with an executable to display the contents of those files, so they are not processes, but files that open a process to show their content.
|
|
|
|
|
you may get the hidden processes (windows services) by using:
ServiceController[] services = ServiceController.GetServices();
Calin
|
|
|
|
|
Hi all,
I need to split a SELECT QUERY fom a database (which i put in a DataTable) from this:
DataTable1
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
0
1
2
0
1
To this:
DataTable1
0
1
2
3
4
5
6
7
8
9
10
DataTable2
0
1
2
3
4
5
6
7
8
9
10
DataTable3
0
1
2
3
DataTable4
0
1
2
DataTable5
0
1
How can i do that??
|
|
|
|
|
It's less that 4 hours since you last asked this question.[^]
Was there something wrong with the coded example you were given there? Maybe you should try solving the problem yourself first, rather than expecting someone else to do it all for you?
It definitely isn't definatley
|
|
|
|
|
Hello,
How we can transform a Excel file to PDF?
thank you verry mutch.
|
|
|
|
|
|
Thank you verry mutch, but i need to transform an excel file and not a htm file, help me please, thank you verry mutch.
modified on Thursday, February 26, 2009 8:32 AM
|
|
|
|
|
You can write to a pdf file, even add images using PDFSharp:
<br />
XGraphics gfx2 = XGraphics.FromPdfPage(page2);<br />
gfx2.DrawRectangle(XPens.Black, XBrushes.LightGray, new XRect(40, 310, 500, 40));<br />
gfx2.DrawImage(XImage.FromFile(@"C:\image1.jpg"), new XRect(30, 30, 100, 107));<br />
<br />
But to graft an Excel file in a pdf! I have not found how to do, help me please, thank you very much
|
|
|
|
|
|
Thank you verry mutch for your help, i do like this :
<br />
static void Main(string[] args)<br />
{<br />
ApplicationClass excelApplication = new ApplicationClass();<br />
Workbook excelWorkBook = null;<br />
<br />
<br />
<br />
string paramSourceBookPath = @"C:\2.xlsx";<br />
object paramMissing = Type.Missing;<br />
<br />
string paramExportFilePath = @"C:\test.pdf";<br />
XlFixedFormatType paramExportFormat = XlFixedFormatType.xlTypePDF;<br />
XlFixedFormatQuality paramExportQuality =<br />
XlFixedFormatQuality.xlQualityStandard;<br />
bool paramOpenAfterPublish = false;<br />
bool paramIncludeDocProps = true;<br />
bool paramIgnorePrintAreas = true;<br />
object paramFromPage = Type.Missing;<br />
object paramToPage = Type.Missing;<br />
<br />
<br />
<br />
try<br />
{<br />
excelWorkBook = excelApplication.Workbooks.Open(paramSourceBookPath,<br />
paramMissing, paramMissing, paramMissing, paramMissing,<br />
paramMissing, paramMissing, paramMissing, paramMissing,<br />
paramMissing, paramMissing, paramMissing, paramMissing,<br />
paramMissing, paramMissing);<br />
<br />
if (excelWorkBook != null)<br />
excelWorkBook.ExportAsFixedFormat(paramExportFormat,<br />
paramExportFilePath, paramExportQuality,<br />
paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage,<br />
paramToPage, paramOpenAfterPublish,<br />
paramMissing);<br />
}<br />
catch (Exception ex)<br />
{<br />
Console.WriteLine(ex.ToString());<br />
}<br />
finally<br />
{<br />
if (excelWorkBook != null)<br />
{<br />
excelWorkBook.Close(false, paramMissing, paramMissing);<br />
excelWorkBook = null;<br />
}<br />
<br />
if (excelApplication != null)<br />
{<br />
excelApplication.Quit();<br />
excelApplication = null;<br />
}<br />
<br />
GC.Collect();<br />
GC.WaitForPendingFinalizers();<br />
GC.Collect();<br />
GC.WaitForPendingFinalizers();<br />
} <br />
<br />
<br />
}<br />
But unfortunately, it doesn't work, help me please, thank you verry mutch.
|
|
|
|
|
|
the error was:
System.ArgumentException: The value is not within the range expected.
à Microsoft.Office.Interop.Excel.WorkbookClass.ExportAsFixedFormat(XlFixedFormatType Type, Object Filename, Object Quality, Object IncludeDocProperties, Object IgnorePrintAreas, Object From, Object To, Object OpenAfterPublish, Object FixedFormatExtClassPtr)
à Excel_to_Pdf.Form1.Form1_Load(Object sender, EventArgs e) dans C:\Documents and Settings\Administrateur\Mes documents\Visual Studio 2005\Projects\Excel_to_Pdf\Excel_to_Pdf\Form1.cs:ligne 53.
Thank you verry mutch
|
|
|
|
|
|
thank you verry mutch,it work for a xlsx file,but unfortunatelly not for xsl file, how i can resolve this problem? thank you verry mutch.
|
|
|
|
|
I tried your code with a xls file and it appears to work. It was an xls made with Excel 2007, though...
As usual, what is the error?
|
|
|
|
|
the error was :
System.Runtime.InteropServices.COMException (0x800A03EC): Exception de HRESULT : 0x800A03EC
à Microsoft.Office.Interop.Excel.WorkbookClass.ExportAsFixedFormat(XlFixedFormatType Type, Object Filename, Object Quality, Object IncludeDocProperties, Object IgnorePrintAreas, Object From, Object To, Object OpenAfterPublish, Object FixedFormatExtClassPtr)
à Excel_to_Pdf.Form1.Form1_Load(Object sender, EventArgs e) dans C:\Documents and Settings\Administrateur\Mes documents\Visual Studio 2005\Projects\Excel_to_Pdf\Excel_to_Pdf\Form1.cs:ligne 68
Thnak you verry mutch.
|
|
|
|
|
No clue, sorry.
Try to search the error "System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT : 0x800A03EC" in Google, hopefully someone already encountered (and solved) this error.
|
|
|
|
|
I don't find the solution, i think that it must be transformed on XSLX, but how we can transform xsl to xslx with c#? thank you verry mutch.
|
|
|
|
|
As I said, in my machine your code worked with an XSL, so maybe the problem is related to the document you are using.
Anyway, you can save an XLSX as XLS by using the SaveAs method on the workbook object and specifying XlFileFormat.xlWorkbookNormal as file format.
|
|
|
|
|
i make this?
excelWorkBook.ExportAsFixedFormat(paramExportFormat,<br />
paramExportFilePath, paramExportQuality,<br />
paramIncludeDocProps, paramIgnorePrintAreas, paramFromPage,<br />
paramToPage, paramOpenAfterPublish,<br />
XlFileFormat.xlWorkbookNormal);
but i does not work, help me please, thank you verry mutch.
|
|
|
|
|