|
this.WindowState = FormWindowState.Minimized;
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
I have a function with a problem as describe in it:
public void Func(Control control)
{
...
...
} I need to know at runtime, whether the control object is actually derived from Form or Button. Any ideas?
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
public void Func(Control c)
{
if (c.GetType().ToString() == "System.Windows.Forms.Form")
{
}
else if (c.GetType().ToString() == "System.Windows.Forms.Button")
{
}
}
|
|
|
|
|
Or you could make it look nicer by
public void Func(Control c)
{
if(c is System.Windows.Forms.Form){
{
}elseif(c is System.Windows.Forms.Button)
{
}
}
|
|
|
|
|
Yes, i do like "nice" looking solution...
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Thanks!
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Here's my scenario:
I want to create a report with a header, details and footer where each of these sections come from a separate typed dataset.
So, for an invoice I want to do the following:
header - client info
details - line items for order
footer - totals for order
I can't go directly to the database with Crystal, so I thought using typed datasets would be OK.
I can create a header report and a line item report with separate typed datasets, but can't come right with one report composing of three typed datasets.
To create one report I'm using:
CrystalReport1 report1 = new CrystalReport1();
report1.SetDataSource(lines); //lines = a typed dataset
crystalReportViewer1.ReportSource = report1;
For the composite report, I've tried:
dsCompo.Tables.Add( lines.Copy());
dsCompo.Tables.Add( companytx.Copy());
CrystalReport4 report4 = new CrystalReport4();
report4.SetDataSource(ds);
crystalReportViewer1.ReportSource=report4;
But the viewer jsut asks for a database login...
I have tried using a subreport, but get the same result.
Is there something obvious I'm missing?
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards
|
|
|
|
|
Same question as above, just after 2 cups of coffee:
Here's my scenario:
I have report A populated with a typed dataset and it works.
I have report B populated with a different typed dataset and it works.
Now I want to combine these 2 into another report.
Using the Crystal.NET designer, I make a new report and add the above 2 subreports.
Given the following code:
CrystalReport4 report4 = new CrystalReport4();
report4.SetDataSource(/* ??? */);
crystalReportViewer1.ReportSource=report4;
What do I set the datasource of my composite report to?
I really need to pass both populated typed datasets in, but the interface is a little unhelpful...
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards
|
|
|
|
|
I'm not sure if you can use multiple DataSet s, but you could merge one typed DataSet with the other and use that. In order to design the report, you might consider creating a typed DataSet that has the merged structure. If you don't want to keep the generated classes for it in your project, you could probably toss it after you're finished designing your report since the merged DataSet would have the same structure.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
Change the Opacity property of your form in a timer or something like that.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
it doesn't work!
the interval property of timer is 100!
this is my code,is there anything wrong?
private void button1_Click(object sender, System.EventArgs e)
{
this.Opacity = 0;
timer1.Start();
}
private void timer1_Tick(object sender, System.EventArgs e)
{
this.Opacity = this.Opacity + 5;
if(this.Opacity >= 100)
{
timer1.Stop();
}
}
Tuliplanet
|
|
|
|
|
Hey.. You have to set the timers interval, when it has to run the method.
Timer newTimer = new Timer();<br />
newTimer.Interval = 1000;
newTimer.Tick += new EventHandler(TheMethod);<br />
<br />
<br />
newTimer.Start();
- Up The Irons, Morten Kristensen
|
|
|
|
|
|
By the way this will solve it:
Tuliplanet wrote:
this.Opacity = this.Opacity + 5;
Change it to
this.Opacity = this.Opacity + 0.05;
You should use numbers between 0 to 1.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
see my reply!!
i set interval=100,but the form just show after a flash!
Tuliplanet
|
|
|
|
|
Hehe.. Easy man. Didnt see that sorry.
Anyways.. You could also use Thread and ThreadStart?
<br />
using System.Threading;<br />
<br />
<br />
ThreadStart ts = new ThreadStart(TheMethod);<br />
Thread t = new Thread(ts);<br />
t.Start();<br />
<br />
<br />
public void TheMethod(){<br />
for(int i = 0;i<=100;i++){<br />
Thread.Sleep(10);<br />
}<br />
}<br />
- Up The Irons, Morten Kristensen
|
|
|
|
|
The problem is not with thread or timer. He set the wrong value for that property.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
I have a xml document with utf-8 encoding and tags name is on cyrilic. I can't use XPath to find a tag. What can I do?
10x in advance
|
|
|
|
|
What do you mean by I can't use XPath? You get error you don't know the proper query string? There are many samples article about XPath in this site and some thers in MSDN too. Have you take a look at them?
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
I'm using KBDLLHOOKSTRUCT.vkCode and need to get char
|
|
|
|
|
You should just be able to cast it to a char :
char c = (char)theStruct.vkCode;
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Point p = new Point(12, 14);
....
p.X = 13;
p.Offset(1, 0);
p = new Point(13, 14);
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Are you sure you're typing an upper-case X and not a lower-case x ? The latter is a private field and thus only accessible from the Point struct itself. Assigning the former (upper-case X ) is fine.
Also keep in mind that the Point struct (like all structs) is a value type. If you think you have a reference to it somewhere else and you didn't pass it using the ref keyword, then you're mistaken. If you pass Point as a param you pass a copy, not a reference. If you're expecting Offset to change that, it won't. Otherwise, it does modify the instance of the Point on which it was called.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|