|
i am having 2 bitmaps and i need to copy them into the third bitmap, how should i proceed plz help
|
|
|
|
|
Create a Graphics object for the third bitmap and use that to draw the other bitmaps onto it.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
i have one object and i want to serialize with XmlSerializer. It is possible to see the field with no data?
EX:
<br />
class kuku<br />
{<br />
int test;<br />
int problem;<br />
}<br />
<br />
class main<br />
{<br />
....<br />
kuku obj=new kuku();<br />
obj.test=10;<br />
XmlSerializer ser=new XmlSerializer(typeof(kuku));<br />
StringWriter writer = new StringWriter(new StringBuilder());<br />
ser.Serialize(writer,obj);<br />
string s=writer.ToString(); <br />
.....<br />
}<br />
<br />
and the s will contain <br />
<br />
<kuku> <br />
<test>10</test><br />
</kuku><br />
<br />
and i want<br />
<br />
<kuku> <br />
<test>10</test><br />
<problem></problem><br />
</kuku><br />
<br />
how can help me???? C# will make me mad!!!!
My brain is in fire
|
|
|
|
|
You will see test=10 and problem=0
class Program
{
static void Main(string[] args)
{
kuku k = new kuku();
k.test = 10;
XmlSerializer xmlSerializer = new XmlSerializer(typeof(kuku));
FileStream fileStream = new FileStream("test.xml", FileMode.Create);
xmlSerializer.Serialize(fileStream, k);
fileStream.Close();
}
}
public class kuku
{
public int test;
public int problem;
}
|
|
|
|
|
What happens, if you explicitely set problem to its default value (0)?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
I used the same code and it didn't generate any problems. I had to make the variables public though. Maybe you should try to fiddle around with their modifiers.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hi!
I am using C# 2005 for my project, i am facing problem with refreshing contents of form. here is the scenario:
i have a DateTimePicker control on form, i want to use it like clock,
i.e. i created a thread which runs a timer, after 1 second im assignning the current time to the DateTimePicker.
Now the control should show the new value but it does'nt refresh.
i tried refresh(), validate() functions but no result...i even called the form_Load function but stil it displays old contents.
I am facing similar problems in some other forms too...
Please tell me wat im missing, do help me in ths regard. Thanks,
Regards,
Affan Toor
|
|
|
|
|
you don't need any special function.
I tried this, and it works:
private void timer1_Tick(object sender, EventArgs e)
{
dateTimePicker1.Value = DateTime.Now;
}
Make sure you set the timer interval to anything smaller than 1000 and that it is enabled (standard it is disabled)
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
joon vh.
THANKS ALOT FOR YOUR REPLY, IT REALLY HELPED ME ALOT IN SOLVING MY PROBLEM.
Thanks again, im looking forward for ur help in future too.
Regards,
Affan Toor
|
|
|
|
|
You should never access a control (in your case the datetimepicker) from a thread other the one that created the control cause this cn cause unexpected behaviour e.g. freezing your app. For more information on this topic and how to correctly access controls from other threads take a look at this article What's up with BeginInvoke?[^]
In the special case of your datetimepicker, the simplest solution would be using a plain windows timer (the one from the forms namespace) since it is designed for a single-threaded environment where UI threads are used to perform processing.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Stefan Troschuetz!
THANKS, ALOT FOR YOUR REPLY, IT REALLY HELPED ME ALOT IN SOLVING MY PROBLEM.
Thanks again, im looking forward for ur help in future too.
Regards,
Affan Toor
|
|
|
|
|
My pleasure
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
Why you are using from datetimepicher?
you can use from javascript. it is very easy.
use this:
<span id="Time"></span>
<script language="javascript" type="text/javascript">
function setPcTime()
{
var myDate = new Date();
document.getElementById('Time').innerHTML = myDate.getHours()+':'+fix(myDate.getMinutes())+':'+fix(myDate.getSeconds());
setTimeout('setPcTime()',1000);
}
setPcTime();
function fix(timefix)
{
if(timefix < 10)return "0"+timefix;
else return timefix;
}
</script>
We Can Do Anything, If We Want It
|
|
|
|
|
Hi everyone.
Please help me.
Did anyone see the component like in Microsoft Project for task indicating?
|
|
|
|
|
|
For example you have project and 4 tasks for finishing this project.
I need a component for visualizing this.
In microsoft Project it looks like a ruler with dates above, and every task is shown there like a line.
For example 1 Task last since 13 March to 23 March, it will be shown first,
The next task since 24 march to 1 april and etc.
And after the fourth task you will see on the rule how much every task takes time, and when your project will be finished.
I think that it is more understood able. I will try to find some examples of this indicators.
|
|
|
|
|
It's called a Gantt Chart. Lots of graph packages allow you to create them. You may want to look at something like Dundas Chart.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks a lot! I will try to do something with it.
|
|
|
|
|
hey,
I have created an *.msi and *.exe for my application but when it's installed I would realy like to have an Uninstaller in the directory. And in het startmenu (where there is an shortcut to the programma) I also want a shortcut to an uninstaller.
Is his possible? Can I make a bash script or something else to do this?
thx!
|
|
|
|
|
See reply to "How do I create an uninstall link on my shortcut?" at http://msdn2.microsoft.com/en-us/library/kz0ke5xt(vs.80).aspx
|
|
|
|
|
I want to make a dialog let user choose a file or folder at the same time. What's the easiest way to do that? Any idea? Please use System.Windows.Forms.OpenFileDialog...
Thanks!
Nathan
|
|
|
|
|
Hi Nathan,
Here it is.
OpenFileDialog ofn = new OpenFileDialog();
ofn.Filter = "XML Files (*.xml)|*.xml";
ofn.Title = "Type File";
if (ofn.ShowDialog() == DialogResult.Cancel)
goto Quit;
Here I am using a open file dialog for xml files. Like wise u can use for different files or all files. Accordingly use the extensions. For all files use *.*
once you have got it, then use a something like the following to read the data from the file. see the concept of streamReader.
FStream = new FileStream(ofn.FileName, FileMode.Open, FileAccess.Read);
Hope this helps.
Keshav Kamat
India
|
|
|
|
|
First of all, the OP is asking for a dialog the lets him open file(s) or a folder. This cannot be achieved with the OpenFileDialog as it is.
Second thing, you should never use goto unless it is really really really necessary. In this case its not. Simply test for DialogResult.OK:
OpenFileDialog ofn = new OpenFileDialog();
ofn.Filter = "XML Files (*.xml)|*.xml";
ofn.Title = "Type File";
if (ofn.ShowDialog() == DialogResult.OK) {
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
you will have to use the following
using System.Windows.Forms;
enjoy
Keshav Kamat
India
|
|
|
|
|
I think you'll have to write such a dialog on your own but maybe you're lucky and somebody has already done that (try searching the net).
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|