|
If that's possible at all, it requires a system wide keyboard hook. There are articles on CP on how to do this, but I'm not sure if it will work. If not, then it's not possible.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes It is possible. You will definitely need a System Wide Hook.
Which version of VB are you using ¿
In VB 6, you will need to use the SystemParametersInfo API. You can implement it like this :
Private Declare Function SystemParametersInfo _
Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Long, ByVal uParam As Long, _
ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long 'API Function to disable keys
Private Sub DisableCtrlAltDel(bDisabled As Boolean)
' Disables Control Alt Delete Breaking
'as well as Ctrl-Escape
Dim X As Long
X = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub
Then the call to the Above function :
Private Sub Form_Load()
Call DisableCtrlAltDel(True) 'disable the system keys
End Sub
'Remember to Enable the system keys again, when the program exits, otherwise it will remain blocked. To re enable them, Just supply False to the DisableCtrlAltDel function.
With VB.NET it is a bit more difficult. Luckily there is a component called mclhotkey, which will give you the functionality of a System Wide Hook. You can find that component here :
http://www.codeproject.com/useritems/mclhotkey.asp?print=true[^]
Hope that helps!
H T G
|
|
|
|
|
Hi,
Sorry forget to tell you what version i am using. I am using vb.net 2005 to develop a windows form.
|
|
|
|
|
Hi,
I find the solution already.
thx
|
|
|
|
|
"end for" can break a for loop.
but how to continue a for?
for example:
For i =0 to 10<br />
if(i =4)<br />
continue<br />
Response.write(i)<br />
Next
the result should be:
012356789
But how to do it in vb??
-- modified at 5:30 Thursday 17th August, 2006
|
|
|
|
|
That looks like perfectly good VB to me, except that I thought you needed 'then' and continue on the same line, unless you put end for.
Another way would be
if (i<>4) then Response.Write(i)
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
mimimimilaw wrote: "end for" can break a for loop.
Hmm, isn't that Exit For ¿¿
|
|
|
|
|
If you have a textbox named Text1 in your form(VB), then this will do the job
For i=0 To 10
If i=4 then
GoTo ss
End If
Text1.Text=Text1.Text & i
ss:
Next
sujithcjose@yahoo.com
http://www.sujith.cjb.net
|
|
|
|
|
I need to fix an installation problem. I have created a setup programm using MS Windows Installer. My project involves VB6, Crystal Report 9 and SQL server 2000. I have used merged module. Setup is built successfully showing no error. I need to run the setup in user computer using admin previlege. It installs and runs successfully in admin previlege login. But when user(doesn't have admin previlege) logs in the computer and tries to use programm, gets runtime error showing message which says like msdatgrd.ocx or one of its dependencies are not registered correctly. When this user is given admin previlege the software runs nicely. Same thing happens for mscomct2.ocx. I need help in this regard urgently.
|
|
|
|
|
iam doing a project in vb.net (winforms) .I have a timespan variable which has a start time and a frequency.this is saved in the database.the field for time is defined as char(this is a must, i can't use datetime or timestamp for storing a time value)
I have a click event on a button called 'view', where a display form should come in which this start time is shown for 24 hrs, each time the frequency is added to the previous one.
For example if the start time is 06.00 and the frequency is 1 hr, then the display form will show from first 06.00 and then one hour added to it , ie 7.00..like this it is shown for 24 hrs from teh start time.
If the frequency is quarterly then 15 minutes is added to each time starting from the start time.
there is no date associated, only time.
So what should i use for this.
For houlry basis I tried using a timespan variable.but when the adding continues, once it reached 23 hrs then it goes to 1.00:00, 1.01:00, 1.02:00 etc etc..instead of 00:00, 01:00, 02:00 respectively
what should be done.please help.it is very urgent.
thanks
chepps.
Chepps
|
|
|
|
|
Why can't you use a datetime or timestamp?
What is your code for incrementing this value?
Steve
|
|
|
|
|
i have used a timestamp variable only
if temp is that variable
then my code will be
temp = temp.Add(TimeSpan.FromHours(1))
this is in a loop for 24hrs.This is showing correctly till 23:00.
Chepps
|
|
|
|
|
You could try something like this:
Dim duration As System.TimeSpan
duration = New System.TimeSpan(0, 1, 0, 0)
Dim temp As System.DateTime
'Initialise temp here
temp = temp.Add(duration)
or you could just use:
Dim temp As System.DateTime
'Initialise temp here
temp = DateAdd("h",1,temp)
You will have to place the Dim's & methods in the appropriate place for your loop.
Hope that helps...
Steve
|
|
|
|
|
I tried this now.Inbetween i got an error.before going deep into the error, i just tried using temp as datetime variable as you suggested rather than a timestamp variable and tried this
temp = temp.Add(TimeSpan.FromHours(1))
and while displaying i suppressed the date part in temp as;
Dim ShowTime As String
ShowTime = FormatDateTime(temp, DateFormat.ShortTime)
and it worked!!!!Thanks a lot.
thank you for the suggestion. i was held up in this for such a long time, by using a timestamp variable and not trying any other options.
Thank you.
chepps
|
|
|
|
|
Great! Glad I could help.
One thing about the timestamp type is that it has a MinValue and MaxValue property which could have been giving you problems...
Steve
|
|
|
|
|
OK.i have not gone into that property.will go through.
Thanks a lot for ur timely help
Regards,
Chepps
|
|
|
|
|
Hello,
working on an app for a buisness...
Now that it's almost done, I'm going threw it again, fixing "details"...
One of those "details" is causing me major problems: pop ups.
I need pop up windows, which I made with the classic JavaScript window.open,
because it's easy to specify all sorts of properties, like no toolbars, sizing...
How can I make those pop ups WITHOUT JavaScript: it gets blocked by recent OS's like xp sp2...
So, pop up windows without javascript, that won't ever get blocked, and where I can specify similar properties as I could with the evil javascript...
(and it's hard to google a solution to this, because 99% of results are javascripts)
Pleeeease help?
|
|
|
|
|
You simply use target="_blank" on a link. The page opens in a new window, but you can't specify any properties for how the window should look.
---
b { font-weight: normal; }
|
|
|
|
|
It's not just links, it's buttons, images, often inside datagrids...
And, without javascript? To size window, remove menu, etc..?
|
|
|
|
|
Help pls!!
Still stuck at this...
It's IMPOSSIBLE to make a popup without javascript?!?!?!
|
|
|
|
|
ii_noname_ii wrote: It's not just links, it's buttons, images, often inside datagrids...
No, it's not. If you don't want to use Javascript, there are only one way of opening a new window, and there are only two elements that can do it. You use the target property, either on a link or on a form. When you use the link or post the form, the new page will open where you specified with the target property.
ii_noname_ii wrote: And, without javascript? To size window, remove menu, etc..?
As I said, you can't.
---
b { font-weight: normal; }
|
|
|
|
|
The client wants a popup window correctly sized...
He also wants it to work for everyone, which is not the case atm with my javascript window.opens...
So, am I gonna be forced to tell him "I can't do that" for the first time in my life..
In any case, this really seems like a missing functionality in vb.net ...
Why haven't "they" ever thought of getting rid of the javascript, so we can code a window opener without the javascript (I have come to HATE javascript with all my heart and feel sick every time I have to use it...)
What about those nasty crack/serial, or porn pages that manage to open popups in your face, despite your popup blocker?
PM or mail me a solution if anyone has one that should not be spread to evil minds... I'll do anything (lol), I really can't stand the thought of having to tell the client "not possible"..
|
|
|
|
|
ii_noname_ii wrote: The client wants a popup window correctly sized...
He also wants it to work for everyone, which is not the case atm with my javascript window.opens...
That is not possible. To open a window at a specific size you need to use Javascript, but as you can disable Javascript or certain Javascript functions in the browser (or using a popup blocker), that can not work for everyone.
ii_noname_ii wrote: In any case, this really seems like a missing functionality in vb.net ...
It has nothing to do with VB.NET what so ever, as you are opening the popup in the browser.
ii_noname_ii wrote: What about those nasty crack/serial, or porn pages that manage to open popups in your face, despite your popup blocker?
Popup blockers may have settings for what popups it allows. If a site manages to follow these rules, it can use a popup. There is also the possibility that the popup is not a popup at all, but just a part of the page that looks like a popup.
---
b { font-weight: normal; }
|
|
|
|
|
Hi everyone,
Not sure if this is the right place for crystal report posts but here I go.
I have a windows application that has been coded in vb.net, in VS2003. the database is MS Access based. I am working on a quotation system and have completed the forms that the user will utilize for input. The windows apps created are not bound to the database and store a local dataset that holds all of the information/tables/data that the user has came in contact with. I would like to create reports that will be populated based on the local dataset. I was wondering if there is any way to create a crystal report, to be used as the template, without binding the report to the database, and then passing the local dataset data into the report that needs to be printed. I have read online about a push method, but they say that can be really slow in creating a report with lots of tables and data, and all of the other solutions are for vs2005. Thank you for reading this post, I am new to crystal reports and am looking for any tutorials etc that might help with this problem. Thank you.
eatwork
|
|
|
|
|
eatwork wrote: working on a quotation system
eatwork wrote: not bound to the database
Just a question - don't you think it would be nice (from a customer services point of view) to keep track of quotes and use them as follow-ups? e.g. If the quote was not accepted, why not?
Your app, just a suggestion.
eatwork wrote: create a crystal report, to be used as the template, without binding the report to the database, and then passing the local dataset data into the report that needs to be printed.
Sure there is & it's real simple. Build your template report first and pass the dataset to the method that calls the report, e.g.
'declare pre-built report
Public myReport1 = New myCrystalReport
Public Sub BuildMyReport(ByVal ds As DataSet)
myReport1.SetDataSource(ds)
myForm.myReportViewer.ReportSource = myReport1
End Sub
Is that what you're after?
|
|
|
|
|