|
Can anyone point me to any opensource C# finite automations software or something that can be related to finite automations theory? Any link on this subject is greatly appriciated.
Thanks in advance!
|
|
|
|
|
|
Hate to disapoint you but I already saw and read that...
Thanks anyway
|
|
|
|
|
Hi,
I have created a user login screen for an application. What i want to achieve is the focus of the login button so that when a user hits the enter key the button is triggered that will process the user name and password.
Thanks for any help.
Regards,
Stephen McAllister
|
|
|
|
|
form1.AcceptButton = your_button.
Process the user name and password from the your_button click event.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Now i am doing dragdrop with my usercontrols, such as button. I got these
two; CF_XMLCODE dataformat and
Microsoft.VisualStudio.Designer.Serlization.DesignerSerializationObject
datatype from the e argument of the dragdrop event. However I can't find any
reference about these two. What are they ? How can i use these to retrieve
all data and recreate my draging usercontrol ?
Thank you
|
|
|
|
|
hii
i am trying to make an flowchart kind of editor. i can draw an object. now i want to implement a click event in that object so that whenever it is selected, i can do something. the code for the object class is :
public class MyObject
{
private int m_X;
private int m_Y;
private int m_Width;
private int m_Height;
private string m_Text;
public MyObject()
{
m_X=m_Y=m_Width=m_Height=0;
m_Text=null;
}
public MyObject(int s)
{
m_X=m_Y=m_Width=m_Height=0;
m_Text=s.ToString();
}
public MyObject(int x,int y, int width,int height)
{
m_X=x;
m_Y=y;
m_Width= width;
m_Height= height;
m_Text="M";
}
public MyObject(int x,int y, int width,int height,string s)
{
m_X=x;
m_Y=y;
m_Width= width;
m_Height= height;
m_Text=s;
}
public MyObject (string s)
{
string[] temp = new string [5];
char[] c = new Char [2];
c[0] = ';';
temp = s.Split(c,6);
X= Int32.Parse (temp[0]);
Y=Int32.Parse (temp[1]);
Width = Int32.Parse (temp[2]);
Height = Int32.Parse (temp[3]);
Text = temp[4];
}
public int X
{
get { return m_X;}
set { m_X= value;}
}
public int Y
{
get { return m_Y;}
set { m_Y= value;}
}
public int Width
{
get { return m_Width;}
set { m_Width= value;}
}
public int Height
{
get { return m_Height;}
set { m_Height= value;}
}
public string Text
{
get { return m_Text;}
set { m_Text= value;}
}
public void Draw (Graphics g)
{
//Graphics g= f.CreateGraphics();
g.DrawEllipse(System.Drawing.Pens.Chocolate ,X,Y,Width,Height);
g.DrawString(Text,new Font("Arial",12),System.Drawing.Brushes.BlueViolet,X,Y);
}
public void WriteToFile(StreamWriter w)
{
w.WriteLine(X +";"+Y + ";" + Width + ";" + Height + ";" + Text);
}
public void Delete()
{
// this.Finalize ();
}
}
}
Please someone help me that if how do i do this : if i click this object then a messagebox if poped up !
thanx in advance
|
|
|
|
|
Create your object as a new user control in your project (Add new item, UI, User control).
The simply add the object to you main from (from the toolbox/My User Controls) and progam the "click" event for the object.
|
|
|
|
|
this is not a user control.
i even tried inheriting my class from usercontrol but then also the click event is not working.
The click event only works on the form. its not working on the Myobjects.. i don't know y.
I feel as if i am totally lost..
please someone help me !!!
|
|
|
|
|
piscian1982 wrote:
The click event only works on the form. its not working on the Myobjects
Because your object is not a control that can trap user events. It draws itself on the form, but you would need the form to trap the click event and forward to your object.
Or your object could install an event handler for the Click event of the form, and check in the delegate if the location of the click is inside your object, and if so, react accordingly. If the point is outside your object, just let the form process its event.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I'm not sure but, in _KeyPress event of a textbox, if you add the code "e.Handled = true;", it works fine. The event is cancelled. But in _KeyDown event it doesn't work.
<br />
private void t2_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
e.Handled = true;<br />
}<br />
Is this a bug? or am I missing something?
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
Yes, it's a bug, it has been fixed in .NET 2.0
Regards
Senthil
|
|
|
|
|
Thanks Senthil.. Same goes for ComboBox control too..
Radgar
"Imagination is more important than knowledge." - Albert Einstein
|
|
|
|
|
hello,
I want to use custom authentication in my web service project. I use asymetric cryptography for loging on the clients. if its OK. I use symmetric cryptography. In brief like that:
1.clients requests the public key of asymetric cryptography from server.
2.server generates and returns it to the client.
3.client encrypts its username, password and the symmetric cryptography's public key and IV and sends them to the server.
4.Server decrypts and authenticates the username and password. if its OK, generates a GUID ticket and encrytp the ticket using the clients public key and IV and sends it to the client.
5.When client calls a webmethod, it send the encrypted ticket and server authenticates the ticket.
I have doupts about the safety of this system.
Can any other person access to the ticket and call a webmethod by using this ticket. What should ı do more?
|
|
|
|
|
|
I am still working on a project to autofill an html form with text fields automatically from a text file. I am running into some trouble. Autofilling on my system is easy. How do you do it when the html is in the browser and on the author's website? I guess it is comparable to google's autofill except im importing from a text file.
ideas?
|
|
|
|
|
I am building a Tetris clone as a tutorial project. I am using a Panel control as the main playing area. The pieces are made up of four Panels that I add to the main playin area panel. When lines are completed I remove the row of Panels by first setting them invisible, performing other tasks, then at the end of the function, removing any invisible Panels:
<br />
foreach ( Panel pnlTmp in this.pnlMain.Controls ) {<br />
if ( pnlTmp.Visible == false ) {<br />
this.pnlMain.Controls.Remove(pnlMain);<br />
}<br />
}<br />
This works great, but as the game goes on, performance starts to take a nose dive. If I do a:
<br />
this.pnlMain.Controls.Clear();<br />
Performance is restored, but I can't keep clearing out ALL the Panels. So it SEEMS that the removed Panels aren't REALLY removed. How do I fully remove them from the main Panel, so that they are truly gone, and performance doesn't suffer more and more as lines are removed?
Thanks!!!
- invid
|
|
|
|
|
centiipede wrote:
// remove the panels
foreach ( Panel pnlTmp in this.pnlMain.Controls ) {
if ( pnlTmp.Visible == false ) {
this.pnlMain.Controls.Remove(pnlMain);//presumably you meant pnlTmp here...
}
}
you might also need to add
<br />
pnlTmp.Dispose();<br />
pnlTmp = null;<br />
to insure it gets garbage collected reasonably soon.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Thanks for the feedback. I have tried the .Dispose() code, and I get a nullReference error. I can try setting it to null, and see if I get a similar error.
Thanks!!
- invid
|
|
|
|
|
the text in bold in my previous post was just a typo then?
Try disposing it before you remove it.
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
HRMM. None of these seem to do the trick, I have tried the following:
<br />
this.pnlMain.Controls.Remove(pnlTmp);<br />
pnlTmp = null;<br />
= Error, cannot set pnlTmp to null, read only error
<br />
pnlTmp.Dispose();<br />
this.pnlMain.Controls.Remove(pnlTmp);<br />
= nullReference error - probably because pnlTmp is gone
<br />
this.pnlMain.Controls.Remove(pnlTmp);<br />
pnlTmp.Dispose();<br />
= null Reference error - see above
<br />
pnlTmp.Dispose();<br />
= null Reference error - possibly because it may still be in the Controls array, even though I have disposed of it?
There must be a way to 'clean' up controls that you have removed from the Controls array. The performance decline is WAY too horrible for me to just ignore. Once 30 or 40 lines are cleared, any time the bricks are moved etc. the CPU shoots through the roof and the application starts to act like it is stuck in a perpetual loop (well not QUITE that bad, but close).
Thank you SO much for your help so far!!!
If you need me to zip the project up and post it somewhere, to help let me know. I am using .NET 2003 (7.1).
- invid
|
|
|
|
|
Hmmm. Something else is going on that is not obvious to you. Do the panels have any references to each other? (clearing them ALL would get around this, but clearing only 'invisible ones might not)
Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
Hmm. I do create Brick classes that contain the panels. maybe I should dispose of these bricks when they 'collide', I *think* that the Panels will remain (I hope), it could be these class instances that is the problem...
Well, except that everything gets 'fixed' when I do a pnlMain.Controls.Clear().
Here is a link to a zip of the project if you would like to poke around it a bit.
Techtris
Thanks!!!
|
|
|
|
|
At first I didn't see anything that made sense (except the the Bricks hold four panel references, but they become "unreachable" when the brick is destroyed).
Then I realized what it was: the remove() call is in the middle of iterating the controls array, which means that the 'next' brick is skipped each time one is removed (the iterator can't track the removals, the 'next' brick assumes the index of the one just removed - it 'moves up'). the bricks end up under other bricks, and their visibility changes around, butr eventually you get a bunch of 'orphans'.
To get around this, change the iteration from a foreach loop to a for loop, but iterate in reverse :
<br />
for(i = controls.count -1; i >= 0,i--)<br />
{<br />
pnlTmp = controls[i] as panel; <br />
if (pnlTmp!=null)<br />
{ <br />
if(!pnlTmp.visible){controls.remove(pnlTmp);<br />
}<br />
}<br />
That way you will remove from the bottom and not skip any (when you remove the 4th, the 3rd is still 3rd).
One of the dangers of that convenient foreach, it makes one forget that it is really just a for (i=0; i<count;i++) and="" since="" there="" is="" no="" 'i'="" to="" watch="" in="" the="" debugger,="" youll="" miss="" problem.
this="" still="" speculation:="" i="" couldn't="" run="" project="" bcauste="" c1="" thingy="" reference="" was="" missing="" it="" wouldn't="" build...=""
<small="">Anger is the most impotent of passions. It effects nothing it goes about, and hurts the one who is possessed by it more than the one against whom it is directed.
Carl Sandburg
|
|
|
|
|
OH... I forgot that I have used the componentOne menu control, sorry. What you've said makes PERFECT sense. I will try it and see what happens. If that doesn't do it, I was thinking that maybe instances of the Brick class might be piling up or something like that. If none of these solutions work, I will replace the componentOne menu and repost the project.
Thank you SOO much for your help!!!
- invid
|
|
|
|