|
I have done this in the past for a Scrabble solver. You can uncomment the line; //retval.Add(current); if you want to see all possible sequences for a scrabble type solution (i.e. solutions that don't use all of the letters). If your word contains duplicate letters, you will have to sort the returned array and take out the duplicate string results.
private List<string> GetAllSequences(string str)
{
List<string> retval = new List<string>();
if (str.Length > 0)
{
if (str.Length == 1)
{
retval.Add(str);
}
else
{
string current;
string theRest;
for (int i = 0; i < str.Length; i++)
{
current = str.Substring(i, 1);
theRest = str.Remove(i, 1);
foreach (string appender in GetAllSequences(theRest))
{
retval.Add(current + appender);
}
}
}
}
return retval;
}
|
|
|
|
|
Is it opssible to use a flash object in a form so when you load the form, it shows the flash object? you knwo a Macromedia Flash object. Is it possible?
In the end we're all just the same
|
|
|
|
|
Hi, DataGrid/WinForm -
a. how do I set column width?
b. how do I set column width to "AutoFit"?
Thanks
|
|
|
|
|
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx
|
|
|
|
|
Hi!
First, many thanks for the good answers one usually receives on this forum!
Now, I would like some hints how I can control the painting of a UserControl. Let's say I have a bunch of buttons and some labels in this control. Then, at some time, I update the label contents and the button colors. But when the actual painting is performed it is not done synchronized, i.e., the buttons (in my case) is drawn slightly before the labels. I don't like the look of that! I would prefer showing the redrawn control AFTER all of its child controls have been redrawn. Is this possible?
Thanks.
Magnus
|
|
|
|
|
What is the community recommendation for a serious .NET C# (2003 pref) profiler? I see Nprof, ANTS, Microsoft, Sementics... more?
|
|
|
|
|
|
Hi
I'm having a C# Windows Appplication with Crystal Reports. Each Reports has about 15-15 sub-reports. When I tried to change one of the sub-report, the other sub-reports are getting modified. All the reports are created in Crystal Report 10 and are bind to SQL SERVER by stored procedures.
Can anyone help me...
Warm Regards
Abhijeet Ballal
|
|
|
|
|
my experience in Crystal Reports is to use as little sub reports as possible.
What do you mean by the other sub-reports are getting modified ?
is the data shown, different? Are the different sub-reports the same subreport, but with a different parameter passed to it?
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Thanks for quick reply..
Exactly.I've modified say Sub-Report 1, I've added one Formula for one field to check for NULL Values. I save the report when I run my App. It's removing some Pie-Charts from say Sub-Report 2.
Yes these are the sub-reports of same reports they are bind to different parameterised Procedures.
Does it because of Version Conflicts?
Warm Regards
Abhijeet ballal
|
|
|
|
|
All the subreports that come from the same subreport will be modified if you make a change. You need to create a different subreport if you don't want that to happen.
good luck.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
string zipFileName=@"d:\sample.txt";
System.IO.FileInfo file = new System.IO.FileInfo(zipFileName);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
Response.Write("Downloaded successfully");
The above code is working pretty good for file download but i want to execute the last statement.How to display that message.
SreekanthJ
-- modified at 6:32 Monday 27th March, 2006
|
|
|
|
|
That is not possible.
As the response you are sending to the browser is the file, there is no page to display the message on.
If you wan't to display the status in the browser, you have to store the status on the server, and have a different page polling the status.
---
b { font-weight: normal; }
|
|
|
|
|
Hi.
I was wondering if someone could give me some pointers. Many are familiar with the GUI in Outlook. For instance on the lower left corner you can click Mail or Calendar and then you get an appropiate window on the right. How is this done? Also, the main window is split into three parts, how is that done?
I am not asking for details although they will be appreciated, a useful pointer would be very nice. What classes can one use?
Thanks a bunch,
FJ
|
|
|
|
|
naglbitur wrote: For instance on the lower left corner you can click Mail or Calendar and then you get an appropiate window on the right. How is this done?
Which Outlook version are you talking about. I use Outlook 2000 and have nothing of that sort.
naglbitur wrote: Also, the main window is split into three parts, how is that done?
Outlook 2000 is divided into 2 parts. My guess is that it is a Splitter control. Check this[^] for reference.
Hope this helps...
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
Hi, thanks for your answer.
I am talking about Outlook 2003, that´s the only program I remember at the moment that has this feature I am refering to so I am afraid I can´t point to any other programs to better explain what I mean. It is similar to TabControl and TabPage.
I am sure you are right about the splitter control, I´ll take a look at it later, thanks for the tip.
Thanks again,
FJ
|
|
|
|
|
Hi!
Simple question:
How do I change the color of the caption of a GroupBox control in .NET 2005? The ForeColor member changes only the color of the controls INSIDE the groupbox. How hard can it be..?
Thanks.
/Magnus
|
|
|
|
|
Hi!
I'd expect the ForeColor of the control containing the GroupBox to be the one shown in the GroupBox caption. Have you tried this yet?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
it changes the caption of the groupbox too on my laptop...
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
i have 4 number
i want to find one number have MinValue
How will i DO ????
AnhTin
|
|
|
|
|
Your question is not very clear, so here are two different answers:
To find the lowest of four values:
int lowest = Math.Min(Math.Min(v1, v2), Math.Min(v3, v4));
To find out if any of four values is equal to MinValue:
bool isMin = (v1 == int.MinValue || v2 == int.MinValue || v3 == int.MinValue || v4 == int.MinValue);
---
b { font-weight: normal; }
|
|
|
|
|
|
i have winapp that use dll (assembly)
im createing in runtime object from the assembly.
then destroy this object.
THEN , while the winapp is STILL RUNNING , i want to Recompile the dll (assembly) , and to use the winapp AGAIN to create object from that assembly .(this way i could ,change the code of the object ,if i found bug, and use it again).
since there was no method like Assembly.Unload(), I use AppDomain,
but with that I still can't unload the assembly.
Here is what my program going
---
class Program
{
static void Main(string[] args)
{
MyTest.Test();
}
}
public class MyTest
{
public static void Test()
{
string assemblyFile = @"D:\XC.dll"; //(1)
string typeName = "XC.Form1"; //(2)
AppDomain appDomain = AppDomain.CreateDomain("Domain test");
try
{
ObjectHandle oh = appDomain.CreateComInstanceFrom(assemblyFile, typeName);
object o = oh.Unwrap();
IXC ixc = (IXC)o; //(3)
}
catch (Exception ex)
{
}
}
};
--
(1)the assebmly file path I want to load
(2)the Type I want to create which implement the IXC interface, and the IXC interface was in the assembly "develop.dll" which is used by the winapp
(3) when it goes to here, I got a exception:
$exception {"Type 'XC.Form1' in assembly 'XC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable."} System.Exception {System.Runtime.Serialization.SerializationException}
--
Any help would be appretiated!
Aaron Lu
|
|
|
|
|
What you are trying to attempt is alot more complicated than what you have there. There are many rules to remoting that must be understood, else you will spend weeks on a pointless journey. Specifically focus on types crossing domain boundries.
Regarding the issue @ (3). Your type has to be marked Serializable or inherit from System.MarshalByRefObject . There could be more, but that is the general way.
|
|
|
|
|
But if I have IXC inherit from System.MarshalByRefObject
then I got a new exception, says: "Unable to cast transparent proxy to type 'IXC'".
|
|
|
|