|
That doesn't follow proper GUI standards at all. If the user presses a keyboard shortcut for a menu item, it should do EXACTLY the same thing as clicking on that menu item.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, I know. But could it be done?
|
|
|
|
|
There is nothing in the MenuItem event handlers that will expose this kind of information. You could try to use the OnKeyDown and OnKeyUp events to track what keys are being used just before the Click event fires on the MenuItem object, but I don't see this as a good or even flexible option to use. Is that much code really worth the odd (and non-intuitive) interface?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can i interrupt a loop operation? Example im iterating over all the records of a 100,000 datareader however i decided to cut short the iteration by clicking a Stop button. How do i do that?
|
|
|
|
|
you can set a temp var
dim tmp as boolean
when you press the button set it to true
in the while code use this
while tmp = true
...
end while
|
|
|
|
|
You add a variable that you check within the loop. Exapmle:
<br />
dim b as boolean as boolean<br />
dim i as long <br />
for i=0 to i=1000<br />
if b=true then<br />
exit for<br />
end if<br />
next i<br />
you change the value of b somewhere else in your code, probably in the "Stop" Button event. You may also want to consider concurrency issues on that variable.
Good Luck.
|
|
|
|
|
erm.. what would the point of this be. You're saying give me the number from this list, when it's this number that I have already.
I'm not sure, but should you not put quotes around a query for a numeric value ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
ralphz wrote:
if i never include 'where TagNo= '"+ ListHardware.selecteditem.tostring+"'" ' then all field is populated
That's because you selected them all.
My advice would be to stay away from computers.
First of all, the advice I gave yesterday is correct, you should get rid of the quotes around the number you're looking for, otherwise you look for it as a string.
Secondly, the SQL as I read it yesterday was something like SELECT ID from myTbl WHERE ID=5. If you know ID is 5, why do you need to select it ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian Graus wrote:
That's because you selected them all.
My advice would be to stay away from computers
Christian, are you the kind of VB programmer that was teased/bullied at school, who now feels he must look down on others in need of help, introducing a side of snide comments and an unfriendly attitude.
|
|
|
|
|
Anonymous wrote:
Christian, are you the kind of VB programmer that was teased/bullied at school,
No, actually, I am an actual programmer ( I don't use VB, and I refuse jobs that require me to ), who comes into the VB forum on the basis that I can help people with VB.NET questions.
Anonymous wrote:
who now feels he must look down on others in need of help
I was actually trying to help.
Anonymous wrote:
introducing a side of snide comments and an unfriendly attitude.
I did feel bad about being rude to this guy afterwards, but the fact is that both myself, and everyone I have shown this code to, thinks it is hilarious. I told the guy (assuming you're a general anonymous pussy and not the guy in question ) that the query was redundant, and he still couldn't work it out. Based on that, he is clearly over his depth, and anyone who is over their depth using SQL or VB should seriously consider if they're up to the world of computers.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
well i'm trying to create a control that inherits from textbox or richtextbox to make the background gradient
i use the following code :
CODE
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
MyBase.OnPaint(e)
Dim gbr As LinearGradientBrush = New LinearGradientBrush(New Rectangle(0, 0, Me.Width, Me.Height), Color.White, Color.Blue, LinearGradientMode.Horizontal)
e.Graphics.FillRectangle(gbr, New Rectangle(0, 0, Me.Width, Me.Height))
End Sub
but this isn't working... the backcolor in both is always white.
can someone help? thanks in advance
|
|
|
|
|
|
What is the correct syntax in a .NET SQL INSERT or UPDATE command which will create a NULL in an integer field in Microsft Access?
Note: because I already do this in other parts of my code through use of datasets and "DBNull.Value", I not only know that it is possible, I can also write a cumbersome work-around using these.
But I believe that some simple way can be found to do this using "OleDbCommand(sql, connection)" and the appropriate string for "sql".
I've tried 'null', nothing, DBNull.Value and several othersin my "sql" string. All give me syntax errors as the code attempts to update the database.
Thanks, Jimbeau
|
|
|
|
|
.NET Framework Class Library
SqlInt32.Null Field
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqltypessqlint32classnulltopic.asp
|
|
|
|
|
Hi All!
Sorry for the cryptic explanation that follows!
My problem is :
i have created a gradient on a form, and then I have put a custom control that i created that just basically implements a picturebox control.
The control is a checkbox control that uses graphics that i made in photoshop, saved as a png file, which incorperates transparency.
The problem is that my control doesnt maintain transparency over this freshly
created GDI+ gradient, however if i was to put the control over a picture say in a picture box that i had loaded from file then it works!
When i do it over the GDI+ stuff, i see a (grey windows default coloured) box around my Checkbox!
If that lot makes any sense to any one i would appr. any help anyone can offer!
Thanks for your help!
|
|
|
|
|
Does anyone know how to lock the keyboard and mouse?
I have a sensitive part in my code where I do not want the user to be able to do anything with the keyboard, not just in my application - nothing at all!
Just for a few seconds I want to lock the keyboard and mouse.
Thanks,
Haim.
|
|
|
|
|
This is definately NOT a good idea! Unless your application is doing something in realtime, like high resolution data sampling, there is no good reason to do this.
But...
You'll have to write a keyboard hook and a mouse hook to "disable" them. There is no API call you can make. In VB.NET you could also just write a couple of Message Filters and add them using Application.AddMessageFilter , the docs are here[^] on MSDN. You would have to filter ALL the keyboard and mouse messages.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
However, after posting my question I did find a way to do it, and after getting a lot of answers like yours I decided to write the following article:
http://www.codeproject.com/useritems/LockKeyboard.asp
Thanks again,
Haim.
|
|
|
|
|
I didn't say it was impossible, just a bad idea! This is something you must be VERY careful to do. I for one, would NOT want my keyboard and mouse disabled for 20 seconds while I go off and do other things while this process is busy performing a long operation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I know there must be a way around this problem I am having, but for the life of me, I cannot find it.
We are currently programming applications in VB.NET, trying to implement Visual Source Safe 6.0.
Our problem, is that we use a large ammount of custom controls and other classes which are shared among various application we are building. How do we get this righ using Source Safe? In essence we need to be able to add solutions to source safe, which in turn can be referenced by any other number of solutions, also kept in source safe.
Please help.
Thanks.
|
|
|
|
|
We had a similar problem, It may be of some help to u,
u can create add the common project to ur existing soln and
put it vss. so that when u get the soln to ur local copy
u get both the projects along.
(In our case the no of projects were less so we got away with this)
cool man
|
|
|
|
|
Hi all,
Is this possible to display a windows form from a remotable object?
I need to create a singlecall server application that gives access to an instance of MapPoint ActiveX control to its clients. And I also would like to display a form from the remotable object containing the ActiveX, so I can see the actual maps being retrieved by the remote clients (for debugging purposes).
In a sense I need to create an Automation-enabled app, so that I can interact with it programmatically or via user interface at the same time. Is this possible with .NET remoting?
Thank you for your input.
Alex
|
|
|
|
|
hi there!please help me with this..we get the data from the TSD(test system directory) and these relaymon data have relaycounts. what im doing is i summed up the relaycounts using the pivot table(in excel).after it summed up,the pivoted data shows.the data(relay monitoring data) have their equivalent relaycode, and these were save in another worksheet.what im trying to do is to get that equivalent relaycode in the worksheet where the pivoted datas are.how will i do that?i couldn't used of select case statement because there are thousands of datas in TSD.each day it has thousands of datas saved.so how am i supposed to do that?pls help me..need asap...tnx a lot!
|
|
|
|
|
i want to record clips using a web cam in vb.net code
can any body help me please on this
if possible send me code on this which will be handy
thanx in advance
i am a sr: Software Engg
|
|
|
|
|
Hi there,
I have been trying to get to read from one DB into a dataset. Then read from the dataset into an XML file and then read from the XML file into a second dataset. Now all of this I got right but the part where I update the DB (a different one to the original) is not working. I am not getting any errors but the table stays empty.
I prosume that the problem is the same as mentioned by Ami but I would appreciate any comments or help regarding this. Below I have included the part of my code that does this.
Kind regards!
Etienne
Dim myAdapter As New SqlClient.SqlDataAdapter
Dim myAdapterLocal As New SqlClient.SqlDataAdapter
Dim objData As New ExtITPOSData.Data
Dim myConnServer As New System.Data.SqlClient.SqlConnection(objData.GetConnectionString)
Dim myConnLocal As New System.Data.SqlClient.SqlConnection(objData.GetLocalConnectionString)
Dim dsServer As New dsSyncronization
Dim dsLocal As New dsSyncronization
'--put data into dataset
myAdapter = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnServer)
myAdapter.Fill(dsServer, "Tax")
dsServer.WriteXml("../Tax.xml", XmlWriteMode.DiffGram)
myAdapter = Nothing
dsServer = Nothing
myAdapterLocal = New SqlClient.SqlDataAdapter("SELECT VAT, GST FROM Tax", myConnLocal)
Try
dsLocal.ReadXml("../Tax.xml", XmlReadMode.DiffGram)
Catch FileNotFound As FileNotFoundException
' The XML data must be written before it can be read
MsgBox("No XML file available. View data online and save to offline.", MsgBoxStyle.Critical)
End Try
Dim myCmdBuilder As New SqlClient.SqlCommandBuilder(myAdapterLocal)
myAdapterLocal.InsertCommand = myCmdBuilder.GetInsertCommand
myAdapterLocal.Update(dsLocal, "Tax")
Thanx!
|
|
|
|