|
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.
|
|
|
|
|
Hi All,
How do I render code of child control (Button,LinkLabel) in parent control (UserControl). Just like Visual studio renders code when Adding DataColumn in DataGridView.
|
|
|
|
|
I don't understand what your saying. Are you asking how to get the child controls of your UserControl to redraw themselves??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for reply, No That can be done throuth Overriding OnPaint Event.
I am working on XPander Control for windows application. It has two part XPanderControl Itself and XPanderList Control to host XPanderControl. I don't want User to drag and drop sub controls (eg button,LinkLabel) in XPanderControl. for this I have created a Propery to add sub Control, just like DataGridView (we adds Columns and type of column(textbox,button) using 'Column Collection' Propery). this all working fine in design mode but on Running program all sub controls losts because there is no static code for subcontrols in page where XPanderControl used. I don't know how to add code for newly added subcontrols in this Page.
Ashok Bansal
|
|
|
|
|
Ashok Bansal wrote: this all working fine in design mode but on Running program all sub controls losts because there is no static code for subcontrols in page where XPanderControl used.
It sounds like you're looking for the DesignerSerialzationVisibility[^] attribute class. Without attaching this to the properties of your controls, the Designer can't generate the "static code" you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
HI all,
i am dynamically desplaying checkboxes depending upon my count,in CHECKEDLISTBOX CONTROL
BUt now i have to desplay a label and checkbox, in a single control
hope u got the point<wanna desplay="" a="" label="" and="" checkbox="" sidebyside="">
can i do with CHECKEDLISTBOX or should i need to take any other CONTROL
bye byes
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Why can't you just show all your text in the checkbox ? You can use Environment.NewLine in your string.
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 )
|
|
|
|
|
thnx for ur response,
but what i mean he is,
now in my application i am desplaying 10properties[from my XmlFile] in my CHECKELISTBOX as CheckBoxes
And now i need to add a label[control] foreach[10]properties PLEASE TELL ME HOW?
finally plz tell me is it possible to desply two controls in CHECKEDLISTBOX?
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
pashitech wrote: And now i need to add a label[control] foreach[10]properties PLEASE TELL ME HOW?
Again, why do you need to add a label, why can't you just set the text of the checkbox ?
pashitech wrote: finally plz tell me is it possible to desply two controls in CHECKEDLISTBOX?
I doubt it.
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 )
|
|
|
|
|
finally plz tell me is it possible to desply two controls in CHECKEDLISTBOX?
here what i mean is,
see i'm desplaying TemparatureProperty and now i need to add description abt TemparatureProperty, Which is another attribute of my backend xml file
so my old output is
checkbox---TemparatureProperty
and my new expected output is
checkbox---TemparatureProperty + (label)TemparatureProperty'sDescription
Hope u got me now.
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|