|
dlg.Parent = this;
or
this.Controls.Add(dlg);
James
Simplicity Rules!
|
|
|
|
|
I believe you will find that both of these solutions will throw an exception when the child is a Form derived object, or more specifically any top level control.
|
|
|
|
|
Yes ... it throw
Wiizi
|
|
|
|
|
See this post for the fix. If you don't want the user to be able to move the window, then set the FormBorderStyle to FormBorderStyle.None;
James
Simplicity Rules!
|
|
|
|
|
Oops, forgot you had to do this first
dlg.TopLevel = false;
James
Simplicity Rules!
|
|
|
|
|
I like...
|
|
|
|
|
I create a class now I want to access to my form from this class.So how can I access to the main form in C#?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
um... you could try...
ApplicationContext.MainForm
|
|
|
|
|
Thanks Andy,I'll check it.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I have this program in which I'm adding TraceSwitches to various subsystems. I got it working fine in one subsystem - so I went ahead and added it to other subsystems. When I try to enable with other switched using my config file - the original switch now throws an XML exception (at the first call to WriteLineIf(), not when newing the TraceSwitch ).
Here are my config files:
The one that works:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<switches>
<add name="FirstSwitch" value="4" />
</switches>
</system.diagnostics>
</configuration>
The one that blows up:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<switches>
<add name="FirstSwitch" value="4" />
<add name="SecondSwitch" value="4" />
<add name="ThirdSwitch" value="4" />
</switches>
</system.diagnostics>
</configuration>
Any ideas what's wrong with the syntax or how to enable multiple switches with a config file?
Thanks
Dale Thompson
|
|
|
|
|
Hi All,
I am trying to view some Reports online through my Internet site.
I am using C# on a Windows 2000 server running IIS5.
I have looked around the internet and found some examples but they are not working. I have the following at the moment.
<cr:CrystalReportViewer
id=CrystalReportViewer1
style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 6px"
runat="server"
ReportSource='<%# "C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt" %>'
Height="1133px"
Width="1030px">
</cr:CrystalReportViewer>
In design view I cn now see my report, but when I compile and view my page I get
CS1009: Unrecognized escape sequence
????
Can someone let me know where I am going wrong and how to sort this out.
Thanks,
Gavin
|
|
|
|
|
it's the back slashes in your ReportSource string.
why do you have it as a server side string???
change it to:
ReportSource='C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt'
|
|
|
|
|
It was set as a server side string because that is how the Crystal Report Viewer set it itself.
What I did was I dragged the CrystalReportViewer off the toolbox and dropped it onto my form.
I then selected it and in the properties window click on the ... next to databindings.
I then went into the ReportSource and put in the exact Source and clicked ok and it did the rest ...
I changed it as you suggested and am now getting the following error.
Cannot create an object of type 'System.Object' from its string representation 'C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt' for the 'ReportSource' property
I'm sure this is meant to be a lot simpler than it has turned out to be?
Thanks for the help
|
|
|
|
|
ok, so try this:
ReportSource='<%# "C:\\Inetpub\\wwwroot\\Outbreak\\Reports\\test.rpt" %>'
or:
ReportSource='<%# @"C:\Inetpub\wwwroot\Outbreak\Reports\test.rpt" %>'
|
|
|
|
|
Okay well that has solved the invalid escape sequence thingie, BUT
now I am getting the following error
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
CrystalDecisions.Web..get_7() +189
CrystalDecisions.Web.CrystalReportViewer.OnInit(EventArgs e) +352
System.Web.UI.Control.InitRecursive(Control namingContainer) +235
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Control.InitRecursive(Control namingContainer) +179
System.Web.UI.Page.ProcessRequestMain() +169
Would this be a problem with the actual report (which seems to work fine of opened in Crystal) or is it still a coding error?
Thanks
|
|
|
|
|
Are there any classes in .NET to zip and unzip files?
third party free classes?
thanks!
Emanuele
- SONORK ID 100.17421 : b0nu$ -
|
|
|
|
|
http://www.icsharpcode.net/OpenSource/NZipLib/default.asp
Andy Gaskell, MCSD MCDBA
|
|
|
|
|
Thanks a lot!
- SONORK ID 100.17421 : b0nu$ -
|
|
|
|
|
I want to play a usual WAV file in my app and don't know how!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Answered here, do a search for PlaySound on this forum...
Regards
|
|
|
|
|
Oaky!
I've found it now!
I'll get back if I get problemos!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
I waana define some Column style for my datagrid somewhere in my codes,I use this code:
DataGridColumnStyle GridSeqStyle;
DGStyle = new DataGridTableStyle();
DGStyle.MappingName = "FS";
PropertyDescriptorCollection pcol = this.BindingContext[myDataSet, "FS"].GetItemProperties();
GridSeqStyle = new DataGridColumnStyle(pcol["FS"]);
GridSeqStyle.MappingName = "SeqNo";
GridSeqStyle.HeaderText = "Sequence No";
GridSeqStyle.Width = 100;
DGStyle.GridColumnStyles.Add(GridSeqStyle);
But I get this error:
Cannot create an instance of the abstract class or interface 'System.Windows.Forms.DataGridColumnStyle'
for this line:----->GridSeqStyle = new DataGridColumnStyle(pcol["FS"]);
Any Suggestion?
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
I got it.I have to use DataGridTextBoxColumn instead.
Mazy
"The path you tread is narrow and the drop is shear and very high,
The ravens all are watching from a vantage point near by,
Apprehension creeping like a choo-train uo your spine,
Will the tightrope reach the end;will the final cuplet rhyme?"Cymbaline-Pink Floyd
|
|
|
|
|
i've added a com component to draw charts in my application, but i can find anywhere in the help the functions associated with this control!!!
doudou
|
|
|
|
|
I not sure which is the best forum to place this question in so I will start here.
I have an web application that has a business logic layer consisting of serveral files in c#. I want to expose some of those methods in the files via a web service. I belive I can expose them using the [WebMethod] attribute. Now, I can also generate an asmx (web service)file for the web services but I can not for the life of me figure out how the asmx file is supposed to find out about the webmethods in the business logic layer.
Any suggestions.
I can easily create an asmx file and write the code directly into the file but that defeats the purpose (i.e. now I have the same logic in two places) Please any help would be great.
|
|
|
|