|
Hi, you need to set an event handler to your control (most likely after having created it).
Check the += operator applied to events.
yourcontrol.CheckedChanged += <here type="" <tab=""> twice and VS will complete the line and create a stub for your event handler>;
Have a look at InitializeComponent() in your form.
Regards.
|
|
|
|
|
In addition to what the previous posters said, you can always iterate through the controls-collection, find all the controls that are of type checkbox, and add an event-handler for them. Just give them a name so that you can find them again, if you need to.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Just started experimenting and I could use a good reference or two on coding for office (specifically word in my case). At this time probably more setup than anything else. I am working on two machines and both appear to have some enviromental issues. machine one, allways gives a message that it could not load the assymbly (both when running in debug mode from VS and when just opening the word document with word.) On machine one word does start from debug mode in VS. On machine two, it fails to start word when trying to run in debug mode from vs, but opens the document with no problems when starting from word. I added text to the last sentance to prove it was running the assymbly in this example.
Anyways, getting frustrated. So any references or just comments on what has and has not worked would be welcome. Thanks
[edit] this is with VS2003 and Office 2003 [/edit]
|
|
|
|
|
Hi
the mousedoubleclick event works fine for text boxes, buttons etc but I can't get it to work for a combobox.
Is there any possible reason why I may be having this basic problem ?
John
|
|
|
|
|
Decided MouseDoubleClick is just MouseClick x 2. This works but there must be a better way to make DoubleClick available for a ComboBox.
private DateTime mouseClicked = DateTime.Now;
.
.
.
private void comboBox1_MouseClick(object sender, MouseEventArgs e)
{
if (DateTime.Now.CompareTo(mouseClicked.AddMilliseconds(SystemInformation.DoubleClickTime)) < 1)
{
mouseClicked = DateTime.Now;
DoubleClicked();
}
else
mouseClicked = DateTime.Now;
}
private void DoubleClicked()
{
MessageBox.Show("DoubleClicked");
}
|
|
|
|
|
I am developing server and client application using .net remoting in c#.
When I run both client and server applications from the same machine, things work fine. But when I host the server on a different machine, exceptions dont get thrown across, rather I get the remoting error with the message
"Server has encountered an internal error,for more information turn off custom Errors in servser's.config file".
I'm using .NET Framework 1.1. on both server and client. The server is hosted in a windows service.
I've read that this can be avoided by setting <customerrors> "off" in the server configuration file. But I am not using config file to configure my windows service.As I configure it programmatically.Can any body tell me how to avoid this error and what is the reason of this??
Thanks
Sam
|
|
|
|
|
samtam wrote: "Server has encountered an internal error".
It's an internal error, it could be anything . Add a config file and set custome errors off like it says to get more information
only two letters away from being an asset
|
|
|
|
|
hi,
i have one xml file
i want one node value in that file ,
how can i load that value into a varibale in c#.net
if possible plz write sample code .
Thanks
|
|
|
|
|
It depends were the value is, a node value or an attribute.
Look up SelectSingleNode, there are plenty of examples available.
only two letters away from being an asset
|
|
|
|
|
Please prove me wrong, cause i'm starting to hate dislike c# more and more
I have a simple winform. On that winform i got arround twenty controls (10 labels and 10 textboxes).
At startup they are all hidden, at some point in time i need to show them all. It is here where the horror strikes me. It is so SLOW. You can literaly see the form being drawn.
Its even wors when i use a background image. After googling (yep i'm a pro;P) i tried to apply double buffering, but this doesn't help at all, one can still see the form being drawn.
How do you desing nice looking forms without this slow painting of the controls.
codito ergo sum
|
|
|
|
|
I think you are doing some more functionality along with hiding and showing controls on your form, cause I created a simple win form with 10 labels and 10 textboxes, made them visible false and on click of a button I made them visible true. Did not find any speed issues.
I guess it's more related to your machine configuration, nothing to dislike C#.
Regards,
Bhupi Bhai.
|
|
|
|
|
Try calling SuspendLayout() showing the controls then calling ResumeLayout().
|
|
|
|
|
I hope I can explain the problem clear enough. I am loading data from my database into a DataSet and then display the data in a ListView. The user can then select one or more of the records in the ListView for deletion and the click the Delete button. After the Update method of the DataAdapter was called, I would like the records that were successfully deleted, to be removed from the ListView, but the records that could not be deleted (for whatever reason: Concurrence problems, has child records, etc) to be highlighted in the ListView. The user can then click on a Report button to see what the reason was for each of the delete errors.
Is this possible? How can this be achieved? I am using Visual Studio 2003 and C#.
Thanks.
Kobus
|
|
|
|
|
First you have to save the records to be deleted for later highlighting them. Save them to a dataset or whatever you find yourself comfortable with.
Then when deleting the rows use try catch error handling. I hope you know how to use try catch stuff. Whatever. Then in the catch part if there are any errors you can your saved datas there and highlight the previously them.
|
|
|
|
|
Hi
I am getting the problem in changing the Default Back Color of the Column header and the Row Header of the DataGridView Control in Visual Studio 2005 C# Dot Net.
Can you please give the solution or the way around.
Ajay Kumar
hy
|
|
|
|
|
There are some properties which end with the word "Style" check those out, their essentially containers for the different themes.
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
I'd like to have Speech to text (Speech Recognition) documentation.
Thank you so much
|
|
|
|
|
For which product?
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
Hi
How i can get some information from file which is separeted by semicore.
For example.
name;age;sex;
i need to put all this into array how to do it?
when i want to read something good just seat and type it
|
|
|
|
|
string text = File.ReadAllText();
string[] array = text .Split(';');
can't get easier than this.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
read all the data from the file and store it in a string. then use the string.split() method of c# to split the array. this will return you array having all the records in it without semicore.
the syntax is
string selectedNode; // to store data from file
char[] splitter = { ';' }; // splitter to be used
string[] machineNode; // array which will contain the data after splitting the //string
machineNode = selectedNode.Split();
now u can use machineNode as any array to retrieve data.
regards
sAqIb
|
|
|
|
|
Hope this helps
Regards
private void _parse(string sourceFile)
{
string[] tokens;
// Check if source file exists
if (File.Exists(sourceFile) == false)
throw new Exception("Source file does not exist");
TextReader TR = File.OpenText(sourceFile);
// Parse file
for (string currentLine = TR.ReadLine(); currentLine != null; currentLine = TR.ReadLine())
{
tokens = currentLine.Split(";".ToCharArray());
}
TR.Close();
}
|
|
|
|
|
Thank's too all of you
when i want to read something good just seat and type it
|
|
|
|
|
I have written a service in C# which does some database stuff. At certain intervals it checks if the Database is still reachable by simply Opening and closing the ODBCConnection object.
It seems however that whenever I open and close the connection the memory used by the process increases (noticed this with windows task manager). This is very unwanted offcourse, since the service I make should run for very long periods of time. I tried creating the ODBCConnection object in a using block, but still the effect is the same. Is this indeed a problem in .NET currently? Am I forgetting a certain action that would dump this memory?
Yesterday I ran this app whole night long, just opening and closing the connection object and this morning I noticed that almost all memory was being used, so I figure that it`s not something that the CLR will clean up.
Please if anybody knows about this problem and any solution give me an answer..
Thanks,
Davy
|
|
|
|
|
Maybe you have to Dispose the object manually... when you don't need your object anymore, try calling the Dispose method or set it to null.
hope this helps.
|
|
|
|