|
I think you should create methods for using serial port on MDI form and call them from the child form. You can find the MDI form from child form using child's MdiParent property.
|
|
|
|
|
hi,
im trying to make an alarm that will just alert in a specified time lenght. Mean it will have 2 parts, First start Time and second End Time. Hope you got my question. I wrote code but it just work till end time is less than 00:00.
For example
If StartTime is 23:00:00 and EndTime is 23:59:00, it will work
but if StartTime is 23:00:00 and EndTime is 01:00:00, it wont
here is the code
DateTime StartTime = new DateTime(1, 1, 1, 23, 52, 40);
DateTime EndTime = new DateTime(1, 1, 1, 1, 01, 10);
if (DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) > 0 && DateTime.Now.TimeOfDay.CompareTo(EndTime.TimeOfDay) < 0)
{
MessageBox.Show("Came");
}
i know DateTime.Now.TimeOfDay.CompareTo(StartTime.TimeOfDay) returns 1 if the time is less than 00:00:00 and greater than the parameter TimeSpan else -1
but i'm not getting any idea since mind is very tired because of lots of proccess
i thought to place a bool variable when that time past but problem is that what if user open the pc when time is 1:00:00 then it wont work
any idea guys ?
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
You are just being far too specific in your comparison. Just compare the DateTime values, i.e. the date and the time of day.
Something like this:
DateTime EndTime = DateTime.Now.AddHours(1);
if (EndTime.CompareTo(DateTime.Now) < 0){
MessageBox.Show("Came");
}
[EDIT: My initial code fragment was rubbish. It make sense now! ]
Alan.
modified on Sunday, December 7, 2008 5:28 PM
|
|
|
|
|
dude, you misunderstood my question. I want comparision in time not with date and time. I do not need date, just time.
for example :
if user open the computer between 23:00 - 01:00 then shows a message to him/her. but problem is 00:00 as i told in first post
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
One way is to split the logic. Something like:
- if the end time > start time, simple check if current time is between start and end
- if the end time < start time it means that you're crossing midnight, then:
- check if current time > start time => alarm
- or if current time < end time, => alarm
|
|
|
|
|
wo wo wo looks like it gonna work...
dude, i always get stucked when i reaches to 00:00 i dunno but brain got flush, something like this hehe well thanks dude
you deserve for a good rate
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Xmen wrote: thanks dude
You're welcome
|
|
|
|
|
Hi every one...can u help me in disabling the border of the group box
thnx in advance,
nagendra kumar
|
|
|
|
|
well, i dont think its good idea to remove its border. You can try panel or just put controls above group box(not in groupbox) and just set its Visible prop. to False.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
If you set visible to false, everything it contains will also be invisible.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
dude, read the post again
"just put controls above group box(not in groupbox) "
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
You're going to have to paint the border yourself.
It might be better to use a Panel control instead of a GroupBox if you want the container functionality but without the border.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
how can i let my application work with plugins (i mean self-written plugins only for that application). I know i can do this with "Reflection", but how can i work with plugins, which should work on mac, linux and so on? Something like the Widgets/Gadgets in Windows-Sidebar, where i have a file, which is a zip-file where the code and so on is inside? How does something like that works?
Has anybody a idea how to do this? Well, i don't want to create a "new programming language" for this plugins, the most plugins like this use javascript, but first, how do i run them? How can i use individual Functions and so on?
Thanks
|
|
|
|
|
the easy way to do this is to add an instance variable of the WebBrowser class and let it execute a page containing the JavaScript. See the sample code for WebBrowser.ObjectForScripting on MSDN:
WebBrowser.ObjectForScripting
This method works fine as long as you can host the WebBrowser control inside a form in your application. Regarding the packaging of your plugins, personally I like the widget concept (as I have to deal with it on a daily basis for a project I am working on). A widget is basically a ZIP file with a certain structure and a manifest file. The manifest file (called config.xml if you follow the w3c standards) points to the main HTML file to execute.
Let me know if you need more help or want more thoughts regarding this.
Cheers,
Marcelo
|
|
|
|
|
Hi,
ok many thanks, but is it possible not to work with the WebBrowser-Object? Maybe with HTMLDocument or an other System like WebKit or else? And is it maybe possible to start events from a object in the HTML from my code? I mean, if i click a button in my Application, i want that the HTML-Page is running a specified js-function.
|
|
|
|
|
Another idea!...
is it possible to embed the javascript-files, classes and so on into my own project? i mean, that they use my classes and functions and i can use their functions, classes, objects and so on?
|
|
|
|
|
i'm trying to open an existing excel worksheet. my code is:
Microsoft.Office.Interop.Excel.Application excelApp;
Microsoft.Office.Interop.Excel.Workbook excelWorkbook;
Microsoft.Office.Interop.Excel.Worksheet ExlWrkSheet;
private object Opt = Type.Missing
excelApp = new ApplicationClass();
excelWorkbook = excelApp.Workbooks.Open("..//..//Data.xls", Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt, Opt);
on the last line i get an exception that he cannot find the file.
i placed the file in the project directory.
i tried also "Data.exl" path when the file is placed in the debug directory, it didn't helped.
what am i doing wrong ?
|
|
|
|
|
Since you have relative path, based on the path, you have to place the excel file two folders above the location where your program starts. You could try using an absolute path first to see that it works and then change the path to relative.
|
|
|
|
|
i tried it with path "c:\\Data.exl" and it works.
for some reason he doesn't recognize relative path.
|
|
|
|
|
Actually what I wrote previously is not quite correct since the relative path is evaluated by Excel so it depends where the excel starts from. Sorry about that.
What you could do is that you use absolute paths in the parameter you pass to the Excel, but if you want the path to be relative from your application point of view, you can use for example Assembly.GetExecutingAssembly and get the location of your application from there. After that you would modify the path the way you want.
|
|
|
|
|
It does recognize relative paths and they are relative to the "current directory". The problem is you cannot reliably control, nor assume, what the current directory is. Just launching the .EXE from a folder does not make that folder the current directory. It could be anything. So, knowing that, best practice is to always use fully qualified path names to the files you're working with. Also, the forward slash character, "/", is reserved for command line switches, even though it does work for paths, this can cause you problems that are hard to trace down in future projects. Back slashes, "\", are reserved for path specifications.
|
|
|
|
|
|
Hi,
in C# string literals a backslash is an escape character, causing the next character to be interpreted in a special way, and a double backslash results in a single one. You never should use double forward slashes though.
|
|
|
|
|
Hello,
I am trying to send to Babylon a word and to preform a copyall there.
I have used the following code taken from sendkeys article in this site:
int windowHandle = Win32.FindWindow(null, "Babylon");
Win32.SetForegroundWindow(windowHandle);
Win32.SetActiveWindow(windowHandle);
System.Windows.Forms.SendKeys.Send(_word);
System.Windows.Forms.SendKeys.SendWait("{ENTER}");
System.Windows.Forms.SendKeys.SendWait("{TAB}");
System.Windows.Forms.SendKeys.SendWait("^A");
System.Windows.Forms.SendKeys.Send("^C");
Now the SetForegroundWindow doesn't work on Babylon(It workes on every other thing I try to use on).
Also after TABBING the ctrl+a and ctrl+c doesn't work....
could someone help me somehow?
|
|
|
|
|
Hi All! I have posted a fe questions, read many tutorials, and doco's, have been on MSDN and Google, and have found absolutely zero support for the task I am trying to accomplish. I am simply trying to find every URL that is found in a plain text file, but it seems almost impossible to do since every sample I have tried, including my own code, does not work. It either brings up too many errors, or just never finds anything. Or both sometimes. Does anybody know of any reliable sources that could simply explain how one would go about finding all URL's inside a text file and saving those URL's to a new file each on a separate line, wether it is using Regex or something else? Any help would be appreciated. Thanks
Regards,
jay.
jay
|
|
|
|
|