|
Hello guys. My name is Sachin. I have a small problem in my project which mostly hangs out my further works.
I have made a c# Windows Application from Visual Studio 2005.
I m posting the two demos of my main project..
Now
1 ) Demo
In this 'Demo' project.. I created few labels and few inherited UserControls. I put the numeric value in front of Basic Salary's usercontrol.. till then its fine.. But when i delete the values from usercontrol11 , some error is coming ...
I m unable to solve this... please help me..
Here is my Demo folder..
Download Demo.rar[^]
2 ) Demo1
In this 'Demo1' project.. Again I created few labels and now with textboxes. I put the numeric value in front of Basic Salary's textbox.. till then its fine.. But when i delete the values from textbox1 , same error is coming ...
If possible please try to help me..
Here is my Demo1 folder
Download Demo1.rar[^]
|
|
|
|
|
Please try for a more intelligent header.
nt_virus wrote: But when i delete the values from usercontrol11 , some error is coming
Try posting code and the error text, not expect people to download your project.
nt_virus wrote: But when i delete the values from textbox1 , same error is coming ...
Probably for the same reason. I would guess you have code that expects a number in there and blows up when there isn't one. Instead of int.Parse, use int.TryParse.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
nt_virus wrote: Hello. Small Help Needed.
Your title is a waste of time
nt_virus wrote: Hello guys. My name is Sachin
Thats nice, but is it really relevant?
nt_virus wrote: some error is coming ...
Do you think that telling us the error would help us in answering your question?
Plus, excuse my laziness, but I really cant be bothered downloading your project (which incidentally I have no way of verifing is legitimate) in order to help you out. The error message, plus some relevant code should more than suffice.
|
|
|
|
|
Hello.. The project is only of 30kbs each.. I m afraid.
Here is the screenshot of when I use usercontrol..
http://i34.tinypic.com/2z8b905.jpg
Code here..
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void userControl11_TextChanged(object sender, EventArgs e)
{
label6.Text = userControl11.Text;
userControl12.Text = Convert.ToString(Convert.ToDouble(userControl11.Text) * .1);
userControl13.Text = Convert.ToString(Convert.ToDouble(userControl11.Text) * .01);
label6.Text = Convert.ToString(Convert.ToDouble(userControl12.Text)+Convert.ToDouble(userControl13.Text)+Convert.ToDouble(userControl11.Text));
}
private void userControl14_TextChanged(object sender, EventArgs e)
{
label6.Text = Convert.ToString(Convert.ToDouble(userControl12.Text) + Convert.ToDouble(userControl13.Text) + Convert.ToDouble(userControl11.Text)+Convert.ToDouble(userControl14.Text));
}
}
}
|
|
|
|
|
I've overriden the OnPaint routine in the GroupBox control to draw the border and text as to how I want it to be drawn.
But unfortunately, it also applies the *same* rendering to all the child controls that are placed within it.
The PaintEventArgs e doesn't have a property like Item or Control so I can't run a check to make sure that the child is an IGroupBox (which is the name of my custom control). So, how can I stop it from applying the render to all the children instead?
Thanks in advance.
|
|
|
|
|
u can use this two :
groupBox1.Contains(Control ctl) to see if the child is in the Group Box
or go to the child and ask him "who is your Parent" with
Control.Parent as ....
Have Fun
Never forget it
|
|
|
|
|
Unfortunately though, like I said, the PaintEventArgs e doesn't have any control properties. Only Graphics and ClipRectangle which means I don't know what's being painted.
How can I disable the OnPaint from rendering the child controls the same way? :\
|
|
|
|
|
Hi,
Does anyone know of a direct C# equivalent, or implementation, of java's System.identiyHashCode method?
Regards,
Dave
Regards,
Dave
|
|
|
|
|
maybe it is object.GetHashCode ???
|
|
|
|
|
That's "an" answer but I don't think it's "the" answer. The rason is that some objects override their base hashcode. And in this case it's the base hashcode that's needed. That's what the Java class returns, if I understand it corrctly.
Regards,
Dave
Regards,
Dave
|
|
|
|
|
did you try to cast that object to "object" and than use that code?
object wctohc = new WeirdClassThatOverridesHashCode();
wctohc.HashCode();
|
|
|
|
|
System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode( obj );
|
|
|
|
|
How Is it possible to turn off hyper threading?
|
|
|
|
|
In your BIOS.
From a coding point of view to run only on one logical CPU (aka hyperthread), you could probably set the processor affinity in the running process.
|
|
|
|
|
I have a value comes from data base like, Mr & Mrs. Taniya
and displaying it in a Lable Control
Lable1.Text = value; // string value comes from database.
But result display without "&" mark i need to display it..
I Cant use two "&&" for that any solution??
|
|
|
|
|
Try: & amp; (but without the space, i added the space since CP changes it to the and sign)
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Gareth H wrote: Try: & amp;
Loverly, a HTML answer for a Winforms question...
|
|
|
|
|
ASysSolvers wrote: I Cant use two "&&" for that any solution?
Why not? That's the way you display an & in a label.
A single & is used to specify a shortcut key, and && is used to display & in the label.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Guffa wrote: Why not?
I suspect the forces of nature is preventing him
|
|
|
|
|
Try setting the UseMnemonic property of the Label to true.
I believe your developing a desktop application. Right?
|
|
|
|
|
Nirandas wrote: Try setting the UseMnemonic property of the Label to true.
You're going to want to set the UseMnemonic property to false, not true to get the ampersand to display in the label's Text property.
|
|
|
|
|
It is working fine, Thank U very much for all.
|
|
|
|
|
how to add a menu item to windows desktop right click menu using C#
(the menu which is comming when u right click on the desktop without selecting any file)
I am using XP and in registry I did like this
But it is not working
HKEY_CLASSES_ROOT\Directory\Background\shell\TestMenu\command
can anybody tell about IContextMenu and QueryContextMenu function
|
|
|
|
|
|
Hi,
In the project, the code can save data into the xml file.
Notice that one of the elements is <sql>
if the data to be saved is only one line for <sql> then it gets saved in a nice format as you see below.
i.e.
<check>
<id>33</id>
<property>Indexing service</property>
<type>service</type>
<enabled>True</enabled>
<note>This is a service</note>
<sql>cidaemon</sql>
</check>
BUT, if the data to be saved has multiple sql lines then the saved format is not nice and proper. It gets saved as below:
<check>
<id>33</id>
<property>Indexing service</property>
<type>service</type>
<enabled>True</enabled>
<note>This is a service</note>
<sql>cidaemon and some
other lines.notice there are more than one
lines here</sql>
</check>
Question:
How can I make sure the above xml is save in a nice format i.e:
<check>
<id>33</id>
<property>Indexing service</property>
<type>service</type>
<enabled>True</enabled>
<note>This is a service</note>
<sql>cidaemon and some
other lines.notice there are more than one
lines here
</sql>
</check>
modified on Thursday, July 17, 2008 7:56 AM
|
|
|
|