|
DateTime.DaysInMonth() is enough for me.
Thank you...
memix
|
|
|
|
|
Hey all
I have a TableLayoutPanel on a form, this form is inherited a number of times by others. This works fine but some of these forms do not need all the rows that are on the default table. I can't see any way of removing a particular row from the layout (ie row 3) on the new forms load. Can this actually be done at run time? It just seems wrong if you can't...
Thanks in advance.
|
|
|
|
|
found this solution on the Scripts, by Losweg
Hi,
I was struggling with the same problem today.
In the first column of my TableLayoutPanel, I'm showing a checkbox.
When the user is checking it, a new row needs to be created.
When the user is unchecking it, the row containing the checkbox should be
removed.
Logically to remove a row in the TableLayoutPanel, I would think to do
something like this:
tableLayoutPanel.RowStyles.RemoveAt(index);
But I found out this is not enough.
You need to clear the controls for that given row as well!
tableLayoutPanel.Controls.RemoveAt(...);
tableLayoutPanel.Controls.RemoveAt(...);
Once the controls in the Controls-collection are gone, the Event that
redraws your tableLayoutPanel doesn't draw them again.
Hopes this is working for you as well...
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Cheers that worked, still a bit of a gap but between rows that are still remaining but it's better than having unused controls. 
|
|
|
|
|
Hi,
i have a problem with a property of my selfmade usercontrol.
The usercontrol contains a toolstrip and i want to make the toolstripitems available as a property.
my usercontrol property is a List<toolstripbutton> but i always get the error in designtime that toolstripbutton isn't marked as serializable.
anyone any idea how i can solve this problem..
thx
Kurt
|
|
|
|
|
Hey,
How can I hide a folder from .NET?
I'm making a folder for writting some files to and at the end of the program I zip that folder. But I want this folder to be invisible for the user.
thx!
|
|
|
|
|
you can make files and folders hidden.
DirectoryInfo di = new DirectoryInfo("foo");
di.Attributes = FileAttributes.Hidden;
hope this works
for files you can use File.SetAttributes.
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
|
Hello,
I have the following problem: I have created my own TextBox class (valid inputs are only numbers => NumericTextBox). It's naturally derived from the .NET TextBox control. It works fine. In the next step I tried to create a control, which can be inserted into a ToolStrip with the designer of VS2005. So I derived from ToolStripControlHost and delivered in the constructor my NumericTextBox. In the abstract it works. Only numbers can be inserted, but the property MaxLength (inherited from the original TextBox) is not supported. For example I set MaxLength to 5 but I can input more than 5 characters (numbers). Has anybody an idea, why this doesn't work?
Alternate: I can derive my ToolStripNumericTextBox from ToolStripTextBox. This works fine, but now I have to maintain the code twice. Once for the normal NumericTextBox and once for the ToolStripNumericTextBox. Can I avoid this?
Greets
Patrick
-- modified at 10:08 Tuesday 3rd April, 2007
|
|
|
|
|
You could try to limit the length yourself in exactly the same spot as where you limit the input to numbers only. I know this is a work around, but at least it's better then having to maintain two sets of the same code.
WM.
What about weapons of mass-construction?
"What? Its an Apple MacBook Pro. They are sexy!" - Paul Watson
|
|
|
|
|
Hi everyone ,
I have a problem here, my program can automatic display 12 files when the button is click.I use timer to let the 12 files to display orderly.
But my question is
" How to allow the 12 files to display randomly everytime when i click the button"
Thank for helpin
|
|
|
|
|
could you explain more ??
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
Yes...
The 12 files is the 12 waveform to be display one by one automatically when i click the button.My program can only allow the 12 waveform to display in order when i run the program( everytime when i run the program, the 12 waveform will display from 1 to 12).
Therefore my problem is " how to allow the 12 waveform to display randomly."
for example when i run the program, the third waveform will run first. And when i run the program the second time, the tenth waveform will run first.
Hope u understand..;)
thank..
|
|
|
|
|
this is what I think you need:
static void Main(string[] args)
{
RunRandomly(12);
}
static void RunRandomly(int amount)
{
ArrayList alreadyused = new ArrayList();
Random rnd = new Random();
while (amount > 0)
{
int rndint = Convert.ToInt32(rnd.Next(12));
if (!alreadyused.Contains(rndint))
{
Run(rndint);
amount--;
alreadyused.Add(rndint);
}
}
}
static void Run(int number)
{
Console.WriteLine(number);
}
if it doesn't make sense, then neither did your question I'm afraid
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
joon vh. wrote: int rndint = Convert.ToInt32(rnd.Next(12));
No need to call Convert.ToInt32 here since Random.Next returns an integer.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
wow... dunno why I assumed it didn't :p good call
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hi there,
I am very new to C#.net, now I have problem to enhance my codes below so that program can upload all the *.txt from the folder to remote server. Right now my code below is only cater for 1 specific file name "text.txt". But I need your advice how can i use *.txt in c#.net. Appreciate for all the respond to my questions.
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if (Request.Files.Count > 0)
{
Request.Files[0].SaveAs(@"C:\Inetpub\wwwroot\EDIHTTPS\test.txt");
}
else
{
|
|
|
|
|
Sorry...to continue the code...
else
{
httpUploadFile("http://localhost/EDIHTTPS/WebForm1.aspx", "c:\\test.txt");
}
}
|
|
|
|
|
Use Directory.GetFiles() method to get the paths of all the files in a folder.
After that you can use Path.GetFileName() to get the name of each file.
|
|
|
|
|
Thanks for your prompt respond.
But I am still kinda blur. Do you have sample coding?
Appreciate that.
|
|
|
|
|
Something like this might help:
string[] thePaths = Directory.GetFiles("c:\\My Folder");
<br />
foreach (string filePath in thePaths)<br />
{<br />
if (Path.GetExtension(filePath) == ".txt")<br />
{<br />
}<br />
}
Have a nice day!
|
|
|
|
|
Hello,
Just an info!
By using the second parameter (searchpattern) of the GetFile method like this:
string[] thePaths = System.IO.Directory.GetFiles("c:\\My Folder", "*.txt");
you don't need the loop!
If you have .Net framework >= 2.0, you also use a "SearchOption", for searching also in the SubDirectories.
All the best,
Martin
|
|
|
|
|
Hi,
How will i convert a XML datatype in SQL to a C# datatype. Can we use XMLDocument datatype in C#? If yes how can it be used?
Thanks in advance
Srivatsan
|
|
|
|
|
|
I want to create a XML document in the filesystem out of the XML that is coming from the table column. The column is of type Xml. So how will i do it. I understand that we can use the ADO classes when oing an updation into the column. How to get it into the code from the database table column?
Srivatsan
|
|
|
|