|
Hi, i would like to create a program to generate a string from characters given, example given with "mnopqrsdef", it will form words out of it.. like "more".. any idea?
|
|
|
|
|
A brute force approach generates permutations of all the subsets and matches them against a dictionary.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Well, first of all, i think you'll need a reference, like a word database or something.
There are a lot of those things around in open source dictionaires.
You'll then need to filter from that database the words that contains characteres from the string you provided.
For example, you pick in the word "more". It contains the letters 'm', 'o', 'r' and 'e'.
You'll pick up your string and find if it contais those letters. If it has, it can go for the result pool.
Hope it helps,
Nuno
|
|
|
|
|
How do I play animated gif or an avi clip in a Form?
_____________________________
...and justice for all
APe
|
|
|
|
|
In the case of a avi, you'll need to drop out a media player to the form.
You can activate the media player component, clicking with the right button in the tool box and click again in "choose items", and then, in components, choosing the windows media player.
After that you'll need to explore the api in order to play the movie.
Pretty simple!
For the gif, maybe a picture box will do it.
Nuno
|
|
|
|
|
There are classes for animated gifs on this site. No, a picture box won't do it, it will just show the first GIF.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I can't find any...
_____________________________
...and justice for all
APe
|
|
|
|
|
Hello all,
Quick question really, hopefully it has a quick answer.
I am using the .NET installutil application to install and register a c# based Windows service. This works like a dream, however when I use this application the service is started after install. This is something I do not want to happen until later in the application install.
Does anybody know of a way of setting the service installer to not start the service on install without changing the ServiceStartMode from Automatic?
|
|
|
|
|
You really don't have a choice. Reset the ServiceStartMode to Manual, then finish whatevr you have to do, then you have to supply code to go into the Service Manager and change the startup mode to Automatic.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I was trying to trigger a event for the del key.
But, as other keys it does nothing.
Del is not a keypress event?
Thx,
Nuno
|
|
|
|
|
I think you have to override the ProcessCmdKey method.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Sorry, i don't know what to do with that answer. Can you be more specific?
Thank you very much
Nuno
|
|
|
|
|
If you overload that method, it will recieve the Delete key. I thought OnKeyDown would also receive it, however.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sorry, i still don't get it.
This is my handler:
<br />
private void deleteRegion(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
<br />
MessageBox.Show(e.KeyChar.ToString());<br />
<br />
SplitContainer sc = (SplitContainer)sender;<br />
<br />
MessageBox.Show("I will delete " + sc.Name);<br />
}<br />
How do i do what you say?
Thx,
Nuno
|
|
|
|
|
sinosoidal wrote: Can you be more specific?
Actually I was specific. Maybe you need a sample:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if ( keyData == Keys.Delete)
{
MessageBox.Show("DEL pressed");
}
return base.ProcessCmdKey(ref msg, keyData);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
Anyone know how to auto copy to clipboard a selected text with left mouse click?
For example, there's an extension for Firefox or you can do that on Linux terminal...
I also know that adiirc, a IRC client developed in c#, has an option with this capability.
Let me know.
Best regards.
|
|
|
|
|
hi all
i have an Exe of a C# project and i want to take its screen shots. i'm not able to do this by the simple method of copy and paste as its not working for the project however it works for any other application.
plz tell me how to take screen shots.
i know this is a little out of context for this forum but as my project is in C# so i've posted this query on this forum
Thanks for ur time
|
|
|
|
|
Saira Tanwir wrote: i have an Exe of a C# project and i want to take its screen shots. i'm not able to do this by the simple method of copy and paste as its not working for the project however it works for any other application.
What I do is make sure the application has focus and hit Alt+PrtScn. Then paste into Paint or something. This isn't working for you?
|
|
|
|
|
No its not working.
any other suggestions???
|
|
|
|
|
When you say C# project, is this a project you're working on in Visual Studio?
|
|
|
|
|
Can someone pls help me with this project
(bouncing ball)Write a program that bounces a blue ball inside a panel.The ball should start moving with a mouseClick event.When the ball hits the edge of the panel it should bounce off the edge and continue to the opposite direction.The ball's position should be updated using a thread and redrawn periodically using another thread.Use the float variable to mantain the ball's position, radius and velocity.Draw the ball using the FillEllipse Method of class Graphics.
Remember to terminate the thread when the user closes the application.
pls help
for(tipzen= theMan;tipzen=superman;tipzen+++)
|
|
|
|
|
Tipzen wrote: Can someone pls help me with this project
Sure, post the code you've already written, and we'd love to help. otherwise, we'd not be helping, we'd be doing your homework.
Is this C# 2.0 ? If so, the backgroundthread class is the one to use. Beyond that, your course materials should tell you all you need to get started, at least. Ask questions when you've tried doing your own homework.
To be honest, these instructions are very explicit. I don't see how you could have trouble starting at least.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
actually i have the same problem and i'll show you what i got so far.
class DrawBall
{
private float initialX;
private float initialY;
private Random generator;
private int direction;
private Panel drawPanel;
private float radius;
private float velocity;
public DrawBall( Panel panel )
{
drawPanel = panel;
generator = new Random();
radius = (float)generator.Next( 10, 30 );
float temp = drawPanel.Size.Width - ( radius * 2 );
initialX = 100;
initialY = 100;
direction = generator.Next( 8 );
velocity = 10;
}
private delegate void DrawBallDelegate( float x, float y );
private void DrawBallInPanel( float x, float y )
{
Graphics myGraphics = drawPanel.CreateGraphics();
myGraphics.FillEllipse( new SolidBrush( Color.Red ),
x, y, radius * 2, radius * 2 );
}
private delegate void ClearPanel();
private void ClearBallsPanel()
{
Graphics myGraphics = drawPanel.CreateGraphics();
myGraphics.Clear( Color.White );
}
public void BallGenerator()
{
while ( true )
{
drawPanel.Invoke( new DrawBallDelegate( DrawBallInPanel ),
new object[] { initialX, initialY } );
Thread.Sleep( 50 );
if ( ( initialX <= drawPanel.Size.Width ) ||
( initialX > 0 ) || ( initialY > 0 ) ||
( initialY <= drawPanel.Size.Height ) )
{
switch ( direction )
{
case 0:
initialY -= velocity;
break;
case 1:
initialX += velocity;
initialY -= velocity;
break;
case 2:
initialX += velocity;
break;
case 3:
initialX += velocity;
initialY += velocity;
break;
case 4:
initialY += velocity;
break;
case 5:
initialX -= velocity;
initialY += velocity;
break;
case 6:
initialX -= velocity;
break;
case 7:
initialX -= velocity;
initialY -= velocity;
break;
}
}
else
{
if ( direction == 0 )
direction = 4;
if ( direction == 1 )
direction = 5;
if ( direction == 2 )
direction = 6;
if ( direction == 3 )
direction = 7;
if ( direction == 4 )
direction = 0;
if ( direction == 5 )
direction = 1;
if ( direction == 6 )
direction = 2;
if ( direction == 7 )
direction = 3;
velocity = (float)generator.Next( 10, 20 );
switch ( direction )
{
case 0:
initialY -= velocity;
break;
case 1:
initialX += velocity;
initialY -= velocity;
break;
case 2:
initialX += velocity;
break;
case 3:
initialX += velocity;
initialY += velocity;
break;
case 4:
initialY += velocity;
break;
case 5:
initialX -= velocity;
initialY += velocity;
break;
case 6:
initialX -= velocity;
break;
case 7:
initialX -= velocity;
initialY -= velocity;
break;
}
}
drawPanel.Invoke( new ClearPanel( ClearBallsPanel ) );
}
}
}
the problem now is that the ball wont stop at the panel borders and just keep moving. i have already tried to remove that bug by putting a if condition.
if ( ( initialX <= drawPanel.Size.Width ) ||
( initialX > 0 ) || ( initialY > 0 ) ||
( initialY <= drawPanel.Size.Height ) )
but it just doesn't work. i have done all the rest of the code including add a thread and mouse event handler.
the only problem now with this condition and the ball that doesn't stop.
Thanks
|
|
|
|
|
Hi All
I'm newbe to OleDb classes.
I'm developing an application that writes on an Excel file using OleDb classes.
To do this there should be a Named Range present in the Excel file.
If I try to use the "Print_Area" name I receive an Exception.
Do you know if it is really possible to use Print_Area and how to do that?
I use the following code for example
"SELECT *.* From Print_Area"
Do I have to tell also what worksheet to use? If it so how to do that?
Regards
ManuStone
|
|
|
|
|
I have a DataGrid in a Windows application form. I have set a button column aside to the data bound from a database.
How do I create a callback function to the clicking of a speciffic button in the DataGrid?
I know that in asp.net I've got the CommandName property of the button, called from the event of the clicking on the DataGrid. I want to do the exact same thing in my Windows application.
|
|
|
|