|
thanx 4 ur reply....
but the unload event is not at all generating when the page is closed.
if u hav idea plz send the code.
thanks once again..
byeeeeeee
|
|
|
|
|
I am learning how to use TreeView:
Added a treeview and a panel component. Doble-click on the TV component and I get the "treeView1_AfterSelect"function.
My nodes are as follows:
NodeA
Node1
Node2
NodeB
node1
When user clicks on Node1, a texBox1 is created on the panel
How can I do this?
Any help is greatly appreciated.
|
|
|
|
|
Get the selected node and decide what to do. The Tag property is very useful for this.
void treeView1_AfterSelect(...)
{
TreeNode node = treeView1.SelectedNode;
if (((int)node.Tag) == 1)
{
panel1.Controls.Add(new TextBox);
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi,
when i close the page(aspx) it has to redirect to another page.
how can we do that.
anybody plzz. help.
advance thanks.
byeeeeee
siri
|
|
|
|
|
Response.Redirect("anotherpage.aspx");
|
|
|
|
|
this may happen by JavaScript, in the onunload event.
"Praying." Is this only what I can do for him ?
|
|
|
|
|
Hello, Everybody.
I have created a customize control in C# using VS.Net 2005(but has the same problem in VS 2003)
then I insert it into a windows application form and setup some properties,
and it compiles without any problem.
But when I reopen the solution second time and I come to design view of the application form, it shows an error message:
Failed to create component 'scontrol'. The error message follows: 'System.ArgumentException: Parameter is not valid.at System.Drawing.Bitmap..ctor(String filename) in the scontrol.cs line98'
line98: Bitmap bw = new Bitmap(@"beforeBtn.bmp");
Then I think it cann't find the image I used for the button backgroundImage of the scontrol.cs. Then I copied the images into the application form directory with solution and also in the bin folder, however it doesn't solve the bug.
Does anyone understand what has happened and why compiler cann't find the image to initialize my scontrol in an application form? How can I make it work?
Cheers
-- modified at 1:08 Saturday 22nd October, 2005
|
|
|
|
|
Hai all,
I am working on an instrumentation project in which i have to display live video coming from a camera.
I couldnt found an appropriate .net form control.
If any body know the related link make a note to me.
Presently I want to develop my own control for live video display.
I am new to .net.
Please anybody help me to get the related documentation so that i can develop the control.
Espesially i want the in formation to acess the video input throut the win32 API.
Varmag
|
|
|
|
|
Hi ,
Supose ,i have name of a file.I want to know it's parent folder and display parent folder in a TextBox .Please help me.
Thanks !
|
|
|
|
|
|
i drew a line from p1 to p2 , now i wanna deal with this line as an object. i can select the line, delete it or move it with the mouse, how can i do this?
|
|
|
|
|
I'm afraid there is no built in support for this. You have to create your own Line objects, associate them with the graphical coordinates and detect movements or deletions by the user.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
i know that, i did it if i had a line from p1 to p2, its easy, using the line equation Y=aX+b u can do anything, but what im tring to do is more Complicated, im trying to make lines ( arrows ) for my UML project, and its hard to make the lines like the other UML Modelling tools, im not getting the idea of how they made the line to be like an object
|
|
|
|
|
The mathematical equation can only draw a line for you, in your case, you need to do the reverse i.e detect a user click and check if the clicked point is on the line.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
try to make a vector line
|
|
|
|
|
Just use VG.net[^]!
A little bit of advertising for ya, Frank
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I am almost done with a project to calculate employee salaries, but am having problems adding a 5% bonus on everyone's final salary. The salary variable is in integer format and I need to convert it to a double. is there a quick and easy way to fix this issue? I am getting the data type error in the Everbody's bonus section. Below is the code ( this is my first program ever, so it is most likely very sloppy, sorry in advance!):
using System;
namespace EmployeeSalary
{
/// <summary>
/// Calculates employee salary based on experience, birthday, position, and company success
/// </summary>
class EmployeeSalary
{
[STAThread]
static void Main(string[] args)
{
int executive, //employee's executive status
finalSalary = 0, //employee's final salary
baseSalary = 5000, //employee's base salary
experience, //employee's years of experience
birthday; //employee's birthday bonus
// Employee's executive status (1 = exec, 2 = not exec)
Console.Write( "Please enter executive code (1/yes 2/no): " );
executive = Int32.Parse( Console.ReadLine() );
if ( executive == 1 )
{
Console.WriteLine( "\nSorry, you're an executive, no benefits for you!" );
goto finalWrite;
}
//Employee's years of experience (1 = less than 3 yrs, 2 = 3 to 5 yrs, 3 = over 5 yrs)
Console.WriteLine( "\nPlease enter your experience code (1/less than 3 yrs, 2/3-5 yrs, 3/over 5 yrs)" );
experience = Int32.Parse( Console.ReadLine() );
if ( experience == 1 ) finalSalary = baseSalary - 2000;
else if ( experience == 2 )
{
finalSalary = baseSalary + 2500;
goto bonusAdd;
}
else if ( experience == 3 )
{
finalSalary = baseSalary + baseSalary;
goto bonusAdd;
}
else
{
Console.WriteLine("That is not a valid entry");
goto bonusAdd;
}
//Employee birthday question
Console.WriteLine( "\nIs this month your birthday (1/yes 2/no)?" );
birthday = Int32.Parse(Console.ReadLine() );
if ( birthday == 1)
{
finalSalary = finalSalary + 250;
goto bonusAdd;
}
if ( birthday == 2) goto bonusAdd;
//Everybody's bonus
bonusAdd:
finalSalary = finalSalary + (finalSalary * 0.5);
//Write final salary
finalWrite:
Console.Write("Your salary for this month is: ");
Console.WriteLine(finalSalary.ToString("c"));
}
}
}
|
|
|
|
|
ivelander wrote: if ( executive == 1 )
{
Console.WriteLine( "\nSorry, you're an executive, no benefits for you!" );
goto finalWrite;
}
You wrote this in order to pass any non-1 chars, this is wrong, because any one may enter 0 for example or any string, you must check the input.
While you have done this in the second input :
ivelander wrote: else
{
Console.WriteLine("That is not a valid entry");
goto bonusAdd;
}
You may do this :
ivelander wrote: finalSalary = finalSalary + 250;
Like this:
finalSalary+=250;
And at last :
ivelander wrote: finalSalary = finalSalary + (finalSalary * 0.5);
double lastResult = Convert.ToDouble(finalSalary);
lastResult += lastResult*0.5;
Hope this helps.
"Praying." Is this only what I can do for him ?
|
|
|
|
|
> I am almost done with a project to calculate employee salaries, but am having problems adding a 5% bonus on everyone's final salary.
Hmm, I've worked at companies that had this very same problem.
Here is an easy way to add 5% to an integer value:
int AddFivePercent( int value )
{
return (105 * value) / 100;
}
Of course, you might want to make a more general case function like AddXPercent(), but I'll leave that as an exercise.
And there is also the option of converting to float, as you mentioned.
Matt Gerrans
|
|
|
|
|
By the way, if you are just starting out, you should know that using goto is a very bad habit -- not one you want to develop.
Matt Gerrans
|
|
|
|
|
I only used it 6 times in less that 100 lines of code... not bad. Haha. Thanks for all the advice, the good news is that things can only get better from here. I'm sure I will be back for more help.
|
|
|
|
|
If you are interested to see how it would be done without any goto s post back. Even better, try doing it yourself without any goto s and if you have in trouble in the process, post your questions here again. After you have it in the goto -free state, you can decide for yourself whether the code seems better.
(Actually, with a small example like this, it will not be clearly better, but I've seen very large pieces of production code that use goto s and that becomes hideously incomprehensible and hard to maintain).
Matt Gerrans
|
|
|
|
|
Need to build a two dimensional math graph.Anybody can give me any ideas about how to do it?
|
|
|
|
|
I have this graphic, that I want to move up and down the form by the user clicking on one button to go up and one button to go down, it sounds like a game, but it really isn't. I have no idea on how to make or even start on this project, can it be done with C#.Net? and do I use DirectX? or the Drawing Class?
|
|
|
|
|
<code
private void="" btnmove_click(object="" sender,="" system.eventargs="" e)
="" {
="" this.location="new" point(this.location.x="" ,="" this.location.y="" -50);
="" which="" moves="" current="" form="" 50="" pix="" up="" and="" so="" on="" ..=""
="" }
="">
I hope this works.
|
|
|
|