|
Weird usage of a progress bar... but you can handle the mouse down and check where the click occured. Based on the location and the size of the progress bar you can determine the value to set.
Alex Korchemniy
|
|
|
|
|
You'd have to handle the MouseDown event of the Progress control. In there, you would get the mouse coordinates where where the user clicked the mouse button. Call the control's PointToClient method with those mouse coordinates to get the point mapped to a usable point in the control. You then have to do some math to determine how far from the left side of the control the user clicked the mouse, then map that number to a value between 1 and 100 so you can set the appropriate value in the ProgressBar's Value property.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
steve_rm wrote:
I have a progress bar and i have the min set to 1 and the max set to 100. I want to be able to click on part of the progress bar and for the progress bar to go to the value that l click on in the progress bar.
Why not use a TrackBar instead?
Roy.
|
|
|
|
|
Process.Start appears to only be able to start a process on the same machine.
Is there a way to start a process or preferably a php program on a remote machine.
What I want is to call a php on the server from a C# program on a workstation.
Regards,
Alf Stockton
|
|
|
|
|
StrayGrey wrote:
Process.Start appears to only be able to start a process on the same machine
True. Otherwise this is a HUGE security risk.
StrayGrey wrote:
Is there a way to start a process or preferably a php program on a remote machine.
You would need to use WMI and the System.Management namespace to launch a remote executable. You'd also need to provide credentials to an account that has administrator rights to the target machine.
Win32_Process[^] WMI class, Create method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i just want to know if i make an applet i mean like java applet and integrate it with html or php to a web page (not using asp.net) now for any client using that applet must have .NET frame work installed but does the server must also have .NET framework installed. i think U understand my question :s
|
|
|
|
|
Yes, your client must have the .NET Framework installed for it to run. If your server is going to be executing managed (C#, VB.NET, Managed C++, ASP.NET) code server-side, then the server has to have the .NET Framework installed also.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
so you mean .. if i make a game in C# only client side and i use php on server side both clients need to have .NET framework installed but server doesn't neeed to.
thax man ..
|
|
|
|
|
True.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In addition to what Dave said, keep in mind that you can only do limited things when running an "applet"; i.e. you can't delete files on the client system, or access the registry, and so on. Doing so will result in a SecurityException. Look up Code Access Security in your favorite search engine to learn more.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality for Christ! Yeah!
Judah Himango
|
|
|
|
|
How can i access parallel or serial ports in C#.
if anyone knows please tell me as early as possible.
arsaldear
|
|
|
|
|
|
Hi,
I am having various controls say... Estimated Start Date, Estimated End Date(both are text fields with date)
How can I perform these validations using Asp.net Validation Controls
1) If I input Estimated End Date, it is compulsory for me to input Estimated Start Date, other wise it can be left empty.
2) Estimated Start Date >= Todays date (if i input it)
Please Help me..
Thanks
|
|
|
|
|
i have two forms...in first form, i have menuitem, on whose click i shld display second form. Also i have two menuitems, when i click either of them i should see the same form, but the label should be different ..like if i click on menuitem1 , the label must have value "from" and if menuitem2 is clicked, then the label should have value "to"...
i want to create property for label...so can you tell how to do it...and where to create?
also how to write this property...ne help will be appreciated...
|
|
|
|
|
private System.Windows.Forms.Label lbl = new Label();
public string ChangableLabel
{
set{this.lbl.Text=value;}
}
private void menuItem[i]_Click(object sender,EventArgs e)
{
form2 f = new form();
f.ChangableLabel = "Some text";
f.Show();
}
|
|
|
|
|
yes it worked..thanks
|
|
|
|
|
thanks
|
|
|
|
|
i'm new in using c#
I need to convert what on the panel to bytes.
I ask u before
u told me to use getpixel
i really don't know how to use it in what i want
so if u can help me or tell me where can i find examples it will be so great.
thx alot
|
|
|
|
|
[C#]
// Sample for the Convert class summary.
using System;
class Sample
{
public static void Main()
{
string nl = Environment.NewLine;
string str = "{0}Return the Int64 equivalent of the following base types:{0}";
bool xBool = false;
short xShort = 1;
int xInt = 2;
long xLong = 3;
float xSingle = 4.0f;
double xDouble = 5.0;
decimal xDecimal = 6.0m;
string xString = "7";
char xChar = '8'; // '8' = hexadecimal 38 = decimal 56
byte xByte = 9;
// The following types are not CLS-compliant.
ushort xUshort = 120;
uint xUint = 121;
ulong xUlong = 122;
sbyte xSbyte = 123;
// The following type cannot be converted to an Int64.
// DateTime xDateTime = DateTime.Now;
Console.WriteLine(str, nl);
Console.WriteLine("Boolean: {0}", Convert.ToInt64(xBool));
Console.WriteLine("Int16: {0}", Convert.ToInt64(xShort));
Console.WriteLine("Int32: {0}", Convert.ToInt64(xInt));
Console.WriteLine("Int64: {0}", Convert.ToInt64(xLong));
Console.WriteLine("Single: {0}", Convert.ToInt64(xSingle));
Console.WriteLine("Double: {0}", Convert.ToInt64(xDouble));
Console.WriteLine("Decimal: {0}", Convert.ToInt64(xDecimal));
Console.WriteLine("String: {0}", Convert.ToInt64(xString));
Console.WriteLine("Char: {0}", Convert.ToInt64(xChar));
Console.WriteLine("Byte: {0}", Convert.ToInt64(xByte));
Console.WriteLine("DateTime: There is no example of this conversion because");
Console.WriteLine(" a DateTime cannot be converted to an Int64.");
//
Console.WriteLine("{0}The following types are not CLS-compliant.{0}", nl);
Console.WriteLine("UInt16: {0}", Convert.ToInt64(xUshort));
Console.WriteLine("UInt32: {0}", Convert.ToInt64(xUint));
Console.WriteLine("UInt64: {0}", Convert.ToInt64(xUlong));
Console.WriteLine("SByte: {0}", Convert.ToInt64(xSbyte));
}
}
/*
This example produces the following results:
Return the Int64 equivalent of the following base types:
Boolean: 0
Int16: 1
Int32: 2
Int64: 3
Single: 4
Double: 5
Decimal: 6
String: 7
Char: 56
Byte: 9
DateTime: There is no example of this conversion because
a DateTime cannot be converted to an Int64.
The following types are not CLS-compliant.
UInt16: 120
UInt32: 121
UInt64: 122
SByte: 123
*/
Nikhil mandalia
Software engineer.
|
|
|
|
|
sorry 4 misunderstanding.
I need to convert the picture on the panel to bytes.
I did that but it works only for the backgroungimage of a panel.
in my program I use 3ds max to draw on the panel
I need to convert the picture on the panel to bytes
thx 4 replying
|
|
|
|
|
this is the function I use to get the bytes of the backgroungimage of the panel
private void fun()
{
pna1.BackgroundImage.Save("m"); //m is the name of the file
bm = new Bitmap("m");
//the size of the panel is 240*160
byte [,] matrix= new byte [240,160];
byte red=0, green=0, blue=0;
byte [] test=new byte [1];
for (int y=0; y < 160; y++)
{
for (int x =0; x < 240; x++)
{
Color u=bm.GetPixel (x ,y);
//I need only one byte represent each pixel
blue = (byte)(u.B/64*64);
green = (byte)(u.G/32*8);
red =(byte)(u.R/32);
matrix[x,y]=(byte)(red + green + blue);
}
}
}
|
|
|
|
|
hello
some one help me plz
|
|
|
|
|
hi!
here is my problem:
as background i'm drawing a ball
gr.DrawImage(Image.FromFile("ball.bmp"),0,0,355,355);
my form is completely transparent and has no borders so i just see my round ball when i start the project.
after i pressed on a button i want to fade in a new picture over a certain part of my ball
i think the easiest way would be a picture box and a timer. every tick i lower the opacity of the new picture. but i don't think there is such an attribute.
another way could be a mixture of solidbrush, where i can set the alpha value and the texturebrush, where i can set an image.
thanks for any help
greetings, kopi_b
|
|
|
|
|
|
hy,
I have to Programm a Wizard. Now i get some problems. I have a MAIN Form and about 21-22 ChildForms. the Main Forms containsa Treeview on the left side, which must be shown everytime, thats why i put it in the ParentForm. All my ChildForms contains "Back" and "Forward" buttons. How can I make the best Practice?? I need to go forward and backward in the wizard. Without loosing the Data stored in every Child Form. How can I call the Form2 from the Form1?? And how can I go backward, without a new Instance of Form2, even i will lost the Data in the textboxes and comboboxes. A I need a powerfull Pattern for that enable me to set to Visible=True and Visible=False, while clicking on the buttons.
I try to add all the Child Forms in MdiChildren Array, but than i cannot realize how to managed them.
BUT I NEED TO COMUNICATE FROM EVERY FORM TO ANOTHER. HOWCAN I DO THAT??
Who can help me??
Giuseppe
|
|
|
|