|
Hi All !
I want to terminate my Application in a specific Time .for example after 3 days , myApplication is locked .thanks a lot for any help !
Regards ,
s_mostafa_h
|
|
|
|
|
As much as some of us like to answer questions on C#. This kind of question is scary. Are you saying your app locks up after three days and you want to terminate it or are you talking about some kind of licensing thing where you want the application to stop working for the user?
www.logifusion.com
|
|
|
|
|
Try this:
You'll have to define a stopTime globally and load it when you load the app (I've just done it in the first form load event)
DateTime stopTime;
private void Form1_Load(object sender, System.EventArgs e)
{
stopTime = DateTime.Now;
}
Then you can add a timer and set it to check every so often
private void timer1_Tick(object sender, System.EventArgs e)
{
if (DateTime.Now > stopTime)
{
Application.Exit();
}
HTH
|
|
|
|
|
thanks for ur reply .
MCSD-Gandalf wrote: Are you saying your app locks up after three days and you want to terminate it
ofcourse , this is an example ...
Regards ,
s_mostafa_h
|
|
|
|
|
I have a windows app that requires I use the Microsoft Datagrid.
My users would like to be able to select multiple rows using the Shift and Ctrl keys, and the datagrid has the selection funtionality built-in, BUT
I can't seem to get the datagrid to respond to the KeyUp event for those keys on the datagrid correctly. It appears that it only fires if I do click on the margin/control area OUTSIDE the rows. I have the same code in a MouseUp event and that event seems to fire correctly, however although I have a breakpoint set in the KeyUp event, it never appears to enter this event.
Does anyone have an idea of what I'm doing wrong, or an example of some KeyUp event at the datagrid level?
Thanks
|
|
|
|
|
I am new to c# and am trying to build my own tabbed web browser.
I have a search bar at the top that has a text field.
I am trying to create a button to highlight the text in the search box field on the current loaded web page.
Kinda like the google search bar does.
Thank you for your time.
|
|
|
|
|
Use the
Document<code> property of the WebBrowser, this will provide access to a class representation of the HTML code. Once you have found the element which you need then you can select the text by using a method inside the object representing the html tag. (I think, sorry I'm in the middle of rebuilding my development machine so can't check this out). <br />
<br />
<hr>You know you're a Land Rover owner when the best route from point A to point B is through the mud.<br />
<br />
Ed
|
|
|
|
|
Thank you for the info. I tried
webpage.Document.Body.InnerHtml.Replace(searchMe.Text , "replaced");
But it doesn't seem to have worked.
I can do what I want with
webpage.Document.ExecCommand("BackColor", false, "Yellow");
but I have to manually select the text.
Anyone know a way I can automattically select text on a webbrowser control?
|
|
|
|
|
If the search box has an ID associated with it then you can use:
WebBrowser.Document.All["id"].InnerText = searchString
Basically this retrieves the HTML element with ID "id" and replaces the text with searchString .
To select the textbox you can use the Focus method of the HtmlElement class to move the focus to the TextBox. To select all the text, perhaps the easiest solution would be to use SendKeys to press Home, Shift + End which will select all the text.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Has anyone actually accomplished this before? If so, can you lead me the way to get it done. I don't need a full blown OCR server or API that cost hundreds or thousands of dollars I just basically need to know if I can parse out a section of printed text on an enrollment form. An id is assigned to a mailing and when the form comes in the person keys in the id on the screen and the image is pulled up. I want to eliminate the need for them to even key it in to prevent from keying a wrong number. Thanks in advance and all I'm looking for is an answer of yes this can be done.
|
|
|
|
|
It's certainly do-able, but you'll spend a lot of time in development, and I'm willing to bet the results will never be 100% perfect.
My advice is to rethink. I've actually worked on projects like this before (speeding up data entry), and the quick, cheap, easy solution is to use barcodes. When the letter is generated, a barcode is printed along with the number, then all the data entry monkey has to do is point it at a barcode scanner upon reciept and hey-presto you're done.
HTH,
Martin.
-- modified at 14:52 Wednesday 24th May, 2006
Typo.
|
|
|
|
|
Thanks Martin, I will definitely look into doing it the barcode way.
|
|
|
|
|
Hi guys, Im looking to create a chat app, based around using webcams - Anyone know where I can find out about this, any guides or tutorials about webcams and streaming to other pcs etc?
Cheers, Ben.
|
|
|
|
|
Maybe the following may help:
WebCam C#
WebCams through WIA
BTW, I just searched for "WebCam +C#".
Regarding streaming maybe VideoLan may be worth a look.
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
Cool thanks
|
|
|
|
|
Hallo guru's,
can somebody give me a short hint what the difference is between the TreeView-Control and the TreeView-Class?
Thanks for your help
|
|
|
|
|
A TreeView is a Control . There's no separate TreeViewControl class.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
They are the same thing, just different termnology. In MSDN I think there is a seperate TreeView Control and TreeView Class entry, but they are talking about the same thing. The Control entry gives you general info of the control itself while the class entry gives you all the "behind the scenes" stuff.
If you add a TreeView control to your form then you are actually adding an instance of the TreeView class to your form class.
|
|
|
|
|
|
I have a ComboBox who’s DropDownStyle is DropDown.
This allows the user to type the first few characters and hit the tab and the visible text on the screen (combo box text area) changes to the item selected. However, the comboBox.Text does not change, nor does the selected index.
Setting AutoComplete makes matters worse. This causes the visible text to be blank.
The only way things seem to work is if I set the dropdownstyle to DropDownList; however this allows only 1st character selection, then the user has to scroll to the appropriate item. Not user friendly.
I must be doing something wrong but am at a loss.
Cheers...Del
|
|
|
|
|
|
Apurva,
Thanks for the response. My problem is with windows forms not web forms. On the surface things look great. Just seems that selectedindex and text fields are not altered....
Cheers...Del
|
|
|
|
|
Hello,
I wonder if it's possible to point to a set of parameters or values when calling a function with a delegate. I have 2 forms and I pass delegate to call functions from form1.
lets say on form2 i have:
public delegate bool CallFuncDelegate();
private int generalX, general Y;
public bool Call(delegate, int a, int b)
{ generalX = a;
generalY = b;
invoke();
}
public bool Func1()
{ int localX = generalX;
int localY = generalY;
....
}
public bool Func2()
{ int localX = generalX;
int localY = generalY;
....
}
On form1 i will assign Func() to the delegate and call it thru Call():
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate, 1, 2);
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate, 8, 9);
So is there a way to call Func() in form one and at the same time tell which parameters to use in form2?
so it's gonna be like this on form2:
public delegate bool CallFuncDelegate();
setofParam1{int generalX =1; int generalY =2};
setofParam2{int generalX=8; int generalY=9};
public bool Call(delegate)
{
invoke();
}
public bool Func1()
{ int localX = setofParam1.generalX;
int localY = setofParam1.generalY;
....
}
public bool Func2()
{ int localX = setofParam2.generalX;
int localY = setofParam2.generalY;
....
}
On form1:
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate); // and then activate set1
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate);// and then activate set2
Sorry for being a little bit confusing. I want to do that because sometimes Func() can have less or more parameters and that required me to change the Call() and it's signature.
Donkaiser
|
|
|
|
|