|
|
lenchase wrote:
Hi,
In vb I could use Exit Sub.
Is there a c# Equivalate for methods with a void return type.
Thanks
Just use "return;" (without the quotes).
Yes, even I am blogging now!
|
|
|
|
|
|
Hello,
I want to copy several huge files to a different folder while showing the progress. I use System.IO.File.Copy() right now, but couldn't find a way to implement a progress bar! Are there any such progress events in .Net?
Any help?
Cheers,
Erica
|
|
|
|
|
You can update the progress bar after every file is copied, to show the advance in number of files.
If you want to display the progress in total number of bytes, you'd have to copy the file manually (open source and destination, read from source, write to destination, and so on...)
One more recommendation: do this in another thread, so you don't block the main application window (thread).
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello!
Does anyone know the code to get an autofilter in a datagrid? This feature exists in Excel and it allows successives filters to data using combobox in column header. If is not possible to code this, is there anyway to call this feature directly from Excel
I'm building a standalone app in c#.
I appreciate your help
Thanks
Rui Fernandes
|
|
|
|
|
You're going to have to code this from scratch or try and find a 3rd partyy DataGrid component that will allow you to do this. Excel will not export it's functionality to a datagrid, it only works with an Excel worksheet.
Basically, you're going to have to provide the user interface, drop down boxes to allow selections of the filters, and provide code to handle the filtering of data (using DataView objects) and binding the datagrid to the new dataviews you create.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello experts,
I'am trying to access TabPages in a TabControl via index and not with it's name
for example
TabControl.TabPages.Remove(Tab0); as
TabControl.TabPages.Remove(0);
Who knows the way to do that ?
Thanks in advance
fracalifa
|
|
|
|
|
fracalifa wrote:
TabControl.TabPages.Remove(Tab0); as
TabControl.TabPages.Remove(0);
Who knows the way to do that ?
Use the RemoveAt() method, instead of the Remove method. Actually, a lot of collections in .NET work this way.
Yes, even I am blogging now!
|
|
|
|
|
|
Hi every one....
I 've a DataGrid...
I need to control the ScrollBars ... some Times I need To Hold them in There Place ... so I get there old value then do some code & reset there values again....
the Values is set & the Scroll Bars is moved to their old position but the DataGrid didn't sence the change in scrolls even there values was changed
I tried
Refresh();<br />
Update();
but nothing happened...
so please I need Some Help
How to make the container respond to its control Changed
A.Mohsen
C# Developer
|
|
|
|
|
Create a new usercontrol inheriting from the DataGrid and use this:
public void ScrollH(int newScrollValue)
{
base.GridHScrolled(this,new ScrollEventArgs(ScrollEventType.LargeIncrement,newScrollValue));
}
public void ScrollV(int newScrollValue)
{
base.GridVScrolled(this,new ScrollEventArgs(ScrollEventType.LargeIncrement,newScrollValue));
}
|
|
|
|
|
Hi
Can i to change on a flew some variable value at debuging time.I.e in the debug mode i set break point and when stop here i would like to change some variable value from currently visible scope on other and after this continue execution with this new value.
Thank.
|
|
|
|
|
|
real_space_monkey wrote:
Hi
Can i to change on a flew some variable value at debuging time.I.e in the debug mode i set break point and when stop here i would like to change some variable value from currently visible scope on other and after this continue execution with this new value.
Thank.
On the debugger, press Shift-F9 on the variable and write the assignment statement (e.g, "x = null", without quotes). Alternatively, add a watch on the variable, double click its value and edit it.
Note that the expression evaluator have serious limitations and not all expressions are valid on the debugger.
Yes, even I am blogging now!
|
|
|
|
|
hi
there is an error in compile of my program.this error is :
"An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation."
in my project there is a user control that use from a picture box into it .when arrive to property image of picture box this error appeared.
this.pictureBox1.AccessibleDescription = resources.GetString("pictureBox1.AccessibleDescription");
this.pictureBox1.AccessibleName = resources.GetString("pictureBox1.AccessibleName");
this.pictureBox1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage")));
this.pictureBox1.Font = ((System.Drawing.Font)(resources.GetObject("pictureBox1.Font")));
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));this.pictureBox1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("pictureBox1.ImeMode")));
this.pictureBox1.Location = ((System.Drawing.Point)(resources.GetObject("pictureBox1.Location")));
after this line ,this error repeat for remain lines.please help me
thanks
bye
|
|
|
|
|
fatidarya wrote:
this.pictureBox1.Location = ((System.Drawing.Point)(resources.GetObject("pictureBox1.Location")));
Put a break point in there and see what the value of the Point is, I suspect something moved very offscreen and/or the designer is serializing it incorrectly (or the image is too big).
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
thanks leppie
but when i delete picture box this error repeat in rows that defined remnant controls (buttons ,..) .
.
.
this.pictureBox1.Text = resources.GetStrin("pictureBox1.Text");
this.pictureBox1.Visible = ((bool)(resources.GetObject("pictureBox1.Visible")));
//
// button4
//
this.button4.AccessibleDescription = resources.GetString("button4.AccessibleDescription");
this.button4.AccessibleName = resources.GetString("button4.AccessibleName");
this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("button4.Anchor")));
this.button4.BackColor = System.Drawing.Color.White;
this.button4.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("button4.BackgroundImage")));
.
....
thanks
|
|
|
|
|
This seems to be related to this .NET bug:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q326219
|
|
|
|
|
Hi!
I have a winows form application. The torm is set to:
this.BackColor = Color.Gray;
this.TransparencyKey = BackColor;
This works great!
On the form i have a pictureBox and i am trying to set the application to:
this.Opacity = 0.78;
But this doesn´t work. The Applications background is showing (the TransparencyKey is lost) and the form has the opacity 0.78...
Any Ideas???
|
|
|
|
|
I found a trick to handle that. Note the Bitmap.MakeTransparent.
[edit] note my image has a white background that i make transparent [edit]
class AboutForm : Form
{
Timer timer = new Timer();
double STEP = 8 / 256.0;
public AboutForm()
{
Opacity = 0;
timer.Interval = (int)(1000 * STEP);
timer.Tick += new EventHandler(timer_Tick);
BackColor = Color.White;
Size = new Size(512, 420);
ShowInTaskbar = false;
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterParent;
TransparencyKey = Color.Black;
Image i = Image.FromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("splash.png"));
Bitmap b = new Bitmap(i);
b.MakeTransparent(Color.White);
BackgroundImage = b;
SetStyle(ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
UpdateStyles();
}
protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
timer.Start();
}
private void timer_Tick(object sender, EventArgs e)
{
if (Opacity >= 1.0)
{
timer.Stop();
return;
}
Opacity += STEP;
STEP *= 1 / 1.01;
}
}
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
How do you get the size of a file? I'm using the File class and it contains methods such us File.GetCreationTime(...) , File.GetLastAccessTime(...) , File.GetLastWriteTime(...) , File.GetAttributes(...) , etc. but there was no File.GetFileSize(...). How do I do this?
-Rafferty
|
|
|
|
|
Rafferty Uy wrote:
How do you get the size of a file?
You've got to use the Length Property[^] of the FileInfo Class[^]:
long FileSize = new FileInfo("C:\\boot.ini").Length;
Best regards
Dennis
|
|
|
|
|
You can use FileInfo Class.
FileInfo fi = new FileInfo(strFileName);
long fileSize = fi.Length;
Maqsood Ahmed
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
I have a service that collects information from a UDP port. I would like to have a program when a user is connect that display information when the service is collecting data.
So, how can a program can be notify by a service ?
(PS.English is not my first language...)
|
|
|
|