|
Remove the 'Hidden' attribute, save your files there and then apply the attribute again. Use the DirectoryInfo class for that.
|
|
|
|
|
actually i don't have to touch the (hidden) folder...this folder is on some other server where i have to copy some xml files.. for testing purpose i tried to copy some files at my local machine and found it doesn't copied at all
Ahuja
|
|
|
|
|
|
I'm not sure why you are having problems. This code works finne for me:
File.Copy(@"H:\Temp\00.xml",@"H:\Temp\MW Scripts\Hidden\bob.xml");
Are you getting any error message?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
yes i got it, i was getting some error because of my fault that i had not given security permission according to my project..
thanks for all your replies...
Ahuja
|
|
|
|
|
Hi,
is there a built in Macanisam for aout Resize?
a Form is been MAX and all of it control are Resized?
THANKS
Have Fun
Never forget it
|
|
|
|
|
I thnk you need a spell checker.
Yes, just set the anchor properties of your controls so they resize as you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: I thnk you need a spell checker.
I think so too
|
|
|
|
|
Hi all
I want to create a Menu in my application.iam using menu control for that.when i use this menu control "one arrow mark is coming in between" the menu items.can anyone tell me how to remove this arrow mark.also post me a link that explains step by step process, how to create a menu control in .net(c#).
any help will be appreciated.
thanks in advance.
pintoo
|
|
|
|
|
Hi Pintoo,
If you are referring to the SubMenu Items arrow then please know that it appear when we create some submenu items for a menu item like:
FileMenu
|
|
New-->SubMenuItemsList
|
|
Open
The arrow can be removed by removing the submenu items.
However, regarding your query of "how to create a menu control in .net(c#)." I would like to mention that we can create menus using C# in the following manner:
First add a MainMenu control to the form. Then to add menu items to it add MenuItem objects to the collection. By default, a MainMenu object contains no menu items, so that the first menu item added becomes the menu heading. Menu items can also be dynamically added when they are created, such that properties are set at the time of their creation and addition.
The following program shows how to create a simple menu.
The Class MenuTest1 creates a simple menu on a form. The form has a top-level File menu with menu items New,Open and Exit .The menu also includes a About menu.
-------------------------------------------------------------------------
BEGIN CODE
using System;
using System.ComponentModel;
using System.WinForms;
using System.Drawing;
public class MenuTest1 :Form
{
private MainMenu mainMenu;
public MenuTest1()
{
mainMenu = new MainMenu();
MenuItem File = mainMenu.MenuItems.Add("&File");
File .MenuItems.Add(new MenuItem("&New"));
File .MenuItems.Add(new MenuItem("&Open"));
File .MenuItems.Add(new MenuItem("&Exit"));
this.Menu=mainMenu;
MenuItem About = mainMenu.MenuItems.Add("&About");
About.MenuItems.Add(new MenuItem("&About"));
this.Menu=mainMenu;
mainMenu.GetForm().BackColor = Color.Indigo;
}
public static void Main(string[] args)
{
Application.Run(new MenuTest1());
}
}
END CODE
-------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
?Hi!,
I've created a new component, in constructor i set a default item
(Nothing in special)
New control definition:
public class NewListBox : System.Windows.Forms.ListBox
{
public NewListBox()
{
Items.Add("Hello World, this should appears one time!");
}
}
But when i drop this control on a form myForm.Designer.cs creates these lines automatically
//
// newListBox1
//
this.newListBox1.FormattingEnabled = true;
this.newListBox1.Items.AddRange(new object[] {
"Hello World, this should appears one time!"});
this.newListBox1.Location = new System.Drawing.Point(398, 6);
this.newListBox1.Name = "newListBox1";
this.newListBox1.Size = new System.Drawing.Size(228, 43);
this.newListBox1.TabIndex = 40;
And the result is the item is adding twice showing in execution
Hello World, this should appears one time!
Hello World, this should appears one time!
How can I avoid these designer automatic initializations.
Thanks in advance
|
|
|
|
|
Please verify that u didn't set the text property of your control at design time.
this appears to be a problem to me as u set the text property at design time and then again adding the same string in constructor
|
|
|
|
|
I'am not setting text property, and also this control has not Text property.
Nouman, the problem is caused by designer, in form.designer unit, when i drop the control it generates the same initiliazition as my control constructor, i know i can delete these lines from form.designer but is not the solution because i use my control in a lot of forms and i should delete these lines every time i use this control (is not logic). I am sure there is way to avoid it.
|
|
|
|
|
Try using the DesignMode or Site property to only adding the sample item when it is _not_ in design mode.
|
|
|
|
|
?thanks darkelv, but it not runs, why?
Because designer still writing
this.newListBox1.Name = "newListBox1";
in form.designer and in execution the control creates the first item due control constructor and the same item again due designer initialization, but thanks for the idea
|
|
|
|
|
Hi All,
Dears
I need method to know Odd and Even number.
from: 0 1 2 3 4 5 6 7 8 9
Thank you in Advance
(Riaz)
|
|
|
|
|
Hi!
Just use the modulo operator % .
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Divide your number with 2 using % operator and if your answer is not zeor than the number is odd else it is even
|
|
|
|
|
|
Hi i want to develop a profiling tool. I just need to add TRACE to a .net assembly's(exe or dll) all methods before its execution.
is it possible to modify the assembly by inserting code for trace?
My small attempt...
|
|
|
|
|
Is there a way to print word docs (without a preview) using word automation?
John
|
|
|
|
|
Hello,all:
I am using ArcEngine(a software managing spatial data) to upload data(shapefile etc.) to database.Because the process of uploading data is time-consuming,when I click the ProgressBar window or minimize the parent window and then maximize the parent window,the parent window and the ProgressBar window is white using single thread.
So,I use multithread to work out this prolem,and it does.But,the speed of uploading data to database slows down greatly . The work uploading data is no more than 10 minutes in single thread,but 40 minutes in multithread!!
Who can help me?I appreciate your help!
private delegate bool UpdateHandle(int nValue,string text);
private UpdateHandle myUpdate = null;
myProcessBar is a Window has two controls,a ProgressBar named Bar and a Label named LabelInfo.It has a public method
BeeUpdate(int value, string text)
public bool BeeUpdate(int value, string text)
{
LabelInfo.Text = text;
LabelInfo.Refresh();
if (value > 0)
{
if (Bar.Value + value < Bar.Maximum)
{
Bar.Value += value;
Bar.Refresh();
return true;
}
else
{
Bar.Value = Bar.Maximum;
Bar.Refresh();
this.Close();
return false;
}
}
return false;
}
the delegate entry point:
private void ShowProcessBar()
{
myProcessBar = new ProgressBee("Uploading", 100 * ClassCount);
myUpdate = new UpdateHandle(myProcessBar.BeeUpdate);
myProcessBar.ShowDialog();
myProcessBar = null;
}
the method called by MainWindow
public bool CopyTo(parm1, parm2,Form caller)
{
MethodInvoker mi = new MethodInvoker(ShowProcessBar);
mi.BeginInvoke(null, null);
caller.BeginInvoke(mi);
Thread.Sleep(2000);
Thread copyProcess = new Thread(delegate()
{
for (int i = 0; i < FeatureClassCount; i++)
{
Thread.Sleep(30);
if (condition)
{
}
else
{
}
caller.Invoke(this.myUpdate, new object[] { 100, "……" });
}
});
copyProcess.Priority = ThreadPriority.AboveNormal;
copyProcess.Start();
return true;
}
|
|
|
|
|
Threads don't speed things up. They slow them down, by causing your UI thread to also take process time. Having said that, what is your UI doing to use up that much time ?
Nothend wrote: Thread.Sleep(30);
Why force a sleep in a process that is already slow ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I'm Trying to Build a Project Manager Form within an MDI application that I've already made. I have the Form Set up, but I'm having problems making it work. What I want to do is Make it so that the user click on a button in the main form and it adds a Task to either a list view or a grid view in the Project Form. Then I want the project form to take the task data and put it into the chart that i have. Each task will show up as an independent series and the start date will mark the start point, the finish date will mark the end point of the series on the char.
As of right now, I don't care for making the Chart work (that will come later). What I want to know is how to make a Grid View or List View control work to display the Project Management Data and how to save that data in a file to be loaded up again.
|
|
|
|
|
I am writing my first Windows programs. I have a welcome form which invokes another form which invokes another form etc.
I want to read data from a data file, store it into a list, and have the contents of the list available to all other forms (code).
If this was one file C++ program , I could choose to declare the list globally (at the top of the file) or to pass the list as parameter to the other functions. However, with all these generated form files, i am a bit confused as how to accomplish the same effect in c#.
Could someone point me in the right direction
|
|
|
|