|
In continuation with my answer in the .Net Framework forum
You could create a single event
Private void Button_Click(object sender, System.EventArgs e)
For each of the buttons you can assign the event handler as
Button1.Click += new System.EventHandler(Button_Click);<br />
Button2.Click += new System.EventHandler(Button_Click);<br />
Button3.Click += new System.EventHandler(Button_Click);<br />
.<br />
.<br />
ButtonN.Click += new System.EventHandler(Button_Click);
Based on the sender you can define what needs to be executed inside the Button_Click Event
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Please see the following link:-
http://www.codeproject.com/useritems/DynamicServerControls.asp
It will help you.
Amit
|
|
|
|
|
Thanks everybody, for the fast and educated responses. I think I'm on my way.
Why is it that .NET, since it implemented a
toolstripmenuitem_DropDownItemClicked event, didn't also provide a
toolstripmenuitem_DropDownItemCheckedStateChanged ? This would have made this process much easier. I realize that not every DropDownItem will support CheckedStateChanged, but even giving me a general
toolstripmenuitem_DropDownItemTheresBeenAnEvent event, and telling me which event in the args, would have been better than nothing...
Thanks again! I'll be back... now that I know where you guys are.
|
|
|
|
|
Hi i am look for a Transparent control with Magnifier functionality just like a windows Magnifier component .i mean how i can make magnifying glass in c#.Net
thanks
-- modified at 4:45 Thursday 21st December, 2006
|
|
|
|
|
Hi All,
Its urgent
I am creating a word template Addinn. I am using "Word Template" project for that. My problem is how can create the set up for "Word Template" project. If any body knows then please help me.
Thanks in advance.
Amit
|
|
|
|
|
Hi,
can any body please help me regarding changing the fonts of any custom string placed any where in the custom control.
Thanks in advance,
regards.
|
|
|
|
|
You can place a string in a control. Either you assign the string to the Text or Caption property of the control, or of a Label that you add as a child control. To set the font of the text displayed, you change the Font property of the control where you put the string.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
hi,
can any body provide me with some help regarding the addition of a horizontal seperator in the context menu for .NET 1.1.
thanks in advance,
regards.
|
|
|
|
|
In the context menu designer, put a hyphen (-) in as the caption. This will be displayed as a separator.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hello frenz,
In my application, I need to recreate & save an xml file frequently in a thread.
I use the Save() of the XmlDocument class to do this.
But at times, when I try to save the file, I get an WIn32IOError exception saying that the file is being used by another process..
Is it possible to check whether the file is being used by another program before saving?
If it is being used by another process, I need my application to wait until the resource is released to rewrite it.
Advance thanks for the help.
|
|
|
|
|
Try this..
File.GetLastAccessTime(@"C:\time.txt"); It will give last access time of the given file. If it is say within some given time limit, you can check it and then wait using Thread.Sleep().. and then continue..
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
u can use this logic as well
DateTime StartTime = DateTime.Now;<br />
while(true)<br />
{<br />
try<br />
{<br />
}<br />
catch<br />
{<br />
if(StartTime.AddSeconds(timeouttime) > DateTime.Now)<br />
{<br />
break;<br />
}<br />
System.Threading.Thread.Sleep(sleeptime);<br />
continue;<br />
}<br />
break;<br />
}
Regards
Shajeel
|
|
|
|
|
|
Hi all
Any good book about Xml Begenner
SAS
|
|
|
|
|
Xml for C#, or are you in the wrong forum ? What do you need to know ? Have you read the w3 schools site, or done a general google ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
... A 100KB file in a 1-dimensional array, byte by byte?
|
|
|
|
|
There should be no problem at all
Luc Pattyn
|
|
|
|
|
Why do it byte by byte? There is a method that creates the array for you and reads the file into it. Check out the File.ReadAllBytes method.
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
I have a form that picks a color and then returns it to the main form. it is then supposed to fade to that color. I have tried using a loop and have tried:
Form1 ReplacementForm = new Form1();
ReplacementForm.Opacity = 0;
ReplacementForm.splitContainer1.BackColor = Properties.Settings.Default.BackGroundColor;
...
ReplacementForm.splitContainer1.Panel2.BackColor = Properties.Settings.Default.BackGroundColor;
ReplacementForm.Opacity = .5;
Thread.Sleep(50);
ReplacementForm.Opacity = .10;
Thread.Sleep(50);
ReplacementForm.Opacity = .15;
Thread.Sleep(50);
...
ReplacementForm.Opacity = .90;
Thread.Sleep(50);
ReplacementForm.Opacity = .95;
Thread.Sleep(50);
ReplacementForm.Opacity = 1;
Thread.Sleep(50);
splitContainer1.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer2.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer3.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer4.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer1.Panel1.BackColor = Properties.Settings.Default.BackGroundColor;
splitContainer1.Panel2.BackColor = Properties.Settings.Default.BackGroundColor;
ReplacementForm.Close();
Neither have worked. Why? what do i have to do to get it to fade from one color to the other? I don't care if it doesn't literally fade colors, as long as it looks like it does.
Thanks in advance.
|
|
|
|
|
Thread.Sleep should always be a last resort. Instead, work out a smooth path from the old color to the new, and set the color incrementally using a timer.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
You had asked the same question some time back. Did you try the suggestions given by the users? Link[^]
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Oops. I'm sorry. I have short-term memory loss.
|
|
|
|
|
I'm trying to find a way to embed various Windows Forms controls (like TextBox, Label, etc.) INSIDE a tree-like control. I'm trying to create something that looks like the Properties window inside the Visual Studio IDE for C# or C++. For example, when you look at the properties for a Button control you see the word Font with a "+" sign next to it. When you click on the "+" sign, it expands to show several font-related rows that each contain a Label column and a TextBox column.
Does anyone know if this is possible? Can it be done without creating a custom control? If it requires a custom control, how would I go about creating it?
Any help is greatly appreciated!
Thanks,
Stephanie
|
|
|
|
|
Have a look at TreeListView[^] control
Tarakeshwar Reddy
MCP, CCIE Q(R&S)
|
|
|
|
|
Hi, I am having a kind of weird problem in my apps.
When I Show a dialog in my app I generally call it like this
using(Dialogs.dlgSomeDialog dialog = new Dialogs.dlgSomeDialog())
{
// do any setup processing here
// show the dialog to the user
dialog.ShowDialog(this);
}
Now the problem I am having is when I close the dialog using the exit button, which just updates any public fields of the dialog form and then
calls this.Hide();, the main form goes to the back of the desktop. So if any other appliations are open, my app goes behind them. Any idea why this happens.
"All of us who served in one war or another know very well that all wars are the glory and the agony of the young."
Gerald Ford
|
|
|
|