|
Yeah i kno Timer concept is not rite.....but ma focus was on keys 'A','B'....y it's not working for them..
rather works totally fine for enter....
Here some changes i made
<br />
Private Sub Form1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress<br />
<br />
If GetAsyncKeyState(Keys.Enter) > 0 Then<br />
<br />
MsgBox("Enter")<br />
<br />
Else<br />
End If<br />
<br />
End Sub
Even this is not working although it's done on Key press event....
|
|
|
|
|
Hi
In the code below It will create a metafile in c:\test\myfile.emf
It should be a image size of 5cm * 5cm
With a vertical line inside of 2cm.
No problem, if I view this in MS word
But in ms paint its all wrong and way to large.
So if I change the line
Dim gr As Graphics = ps.CreateMeasurementGraphics()
to
Dim gr As Graphics = Me.CreateGraphics()
This time paint is OK and MS Word 2000 is ok,
But MS word 2007 reports the line as 2.69 cm.
So does Adobe Illustrator
If I create the same metafile in Adobe Illustrator its perfect for all programs, so it must be possible in VB I hope
Any thoughts
Thanks
Mark
Dim mf As Metafile
Dim ps As New PrinterSettings()
'Dim gr As Graphics = ps.CreateMeasurementGraphics()
Dim gr As Graphics = Me.CreateGraphics()
gr.PageUnit = System.Drawing.Imaging.MetafileFrameUnit.Millimeter
gr.PageScale = 1
Dim me_hdc As IntPtr = gr.GetHdc
mf = New Metafile("c:\test\myfile.emf", me_hdc, New Rectangle(0, 0, 50.0F, 50.0F), MetafileFrameUnit.Millimeter, EmfType.EmfOnly)
gr.ReleaseHdc(me_hdc)
gr.Dispose()
g = Graphics.FromImage(mf)
g.PageUnit = System.Drawing.Imaging.MetafileFrameUnit.Millimeter
g.PageScale = 1
g.FillRectangle(Brushes.Black, 0.0F, 0.0F, 1.0F, 20.0F)
g.Dispose()
|
|
|
|
|
I am working on this program in VB Studio 2010. It detects the computers on the network and checks if they are being used or free. I can check their presence on the network by using :
Dim pingsender As New Ping
Dim HostName As String
'For x = 1 To 3
For i = 0 To 9
HostName = "CN0809B2-DW061" + i.ToString '+ x.ToString
If pingsender.Send(HostName).Status = IPStatus.Success Then
txtPingResult.Text += String.Format("Reply from: " & HostName & vbCrLf)
Else
txtPingResult.Text += String.Format("No Reply From: " & HostName & vbCrLf)
End If
Me.Refresh()
'Pause for 1 second before pinging again
System.Threading.Thread.Sleep(1000)
'Next
Next
txtPingResult.Text = ""
Any help to go further and check if computer is logged on ? can get user name by using :
Dim name As String = Environment.UserDomainName & " \ " & Environment.UserName
Will i need client/server program or can i do this by some other method ?any advices more then welcome...Thanks <pre></pre>
|
|
|
|
|
You can get the logged on users by executing a WMI query on the remote machine and getting all instances of the Win32_LoggedOnUser[^] class.
You can find examples of WMI and VB.NET here[^].
|
|
|
|
|
It really think depends on how you define 'free'.
The problem there though is that I think Win32_LoggedOnUser returns all logged on users, even system accounts and accounts set up by apps that have services running in the background. I would check on that and see if it aligns with what you want to do.
Do you want to know if:
- There is a user logged on sitting active at the machine right now?
- The user is logged in but walked away and the system is idle?
- There is no user even logged in at all but the machine is on?
Just asking because I was working on something that needed to know these specific states before and I MIGHT be able to find some code for you...
|
|
|
|
|
thanks for your help guys, it is highly appreciated.
@ Ray ... the user is logged on and sitting on the machine. I have to use it for a computer room where there is for example say 4 computers. So just need to show on a screen if the computers are switched on and if on then is they any user on it. Basically if someone is logged on then it will mean the computer is not free to use and if no one logged in then one can jump on it. I can ping all the machines to check if they are online just the next bit I been working on is confusing and need help with it. thanks again guys!
|
|
|
|
|
I have made a trigger in oracle 10g
n now i want to get the value of trigger in my windows form
but me nt getting the value
i wnt the value after i click on save button
Plzz helpp
|
|
|
|
|
"value of trigger" doesn't make any sense. The trigger won't return anything to your query from VB.NET, unless you're executing some stored proc on the database and that proc returns a value.
No, I don't have any examples since I, thankfully, haven't worked on Oracle in about 7 years.
|
|
|
|
|
What does the trigger do? Does it add an automatically generated id to a newly inserted row? Then you should query the current value of the corresponding sequence (which was used in the trigger): SELECT MYSEQUENCE.CURRVAL() FROM DUAL
|
|
|
|
|
Hello.
Help me to uderstand how to extend standard context menu of TextBox control in VB6.
I've got a project with a textbox. The text box has by default a context menu.
So the question is how to append to the context menu my own items?
Any useful advices and methods are welcome
P.S. Search in MSDN, Google, yandex etc. is unsuccessful.
|
|
|
|
|
P$YCH0 wrote: Any useful advices and methods are welcome
Demonstration[^]-code is on the left of that page
I are Troll
|
|
|
|
|
Thank you, but I don NOT need tones of f**kin libraries to show a simple context menu.
Do you realy think its smart solution using timer to monitor a control? LOL
Guys, Is any human solutions exists?
|
|
|
|
|
P$YCH0 wrote: Is any human solutions exists?
Quite possibly; you could do worse than look here[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thank you
But that's not the goal.
I need to add items in standard menu of a textbox. The textbox exists in my application. My application wrote using VB6.
I don't need to DISABLE context menu! I don't want CREATE my own menu! I don't want to REWRITE my application in .NET or C++ only to realize my wish (at least it's just context menu!)!
I just want to get ('handle to' or 'use system resource' or 'something else') existing menu and modify it!
|
|
|
|
|
P$YCH0 wrote: I don't need to DISABLE context menu! I don't want CREATE my own menu!
That's what you'll have to do indeed; most languages don't support extending the default context-menu, only replacing it with a custom one.
P$YCH0 wrote: I just want to get ('handle to' or 'use system resource' or 'something else') existing menu and modify it!
That 'might' be done using a custom message handler, search for "WinProc" and WM_CONTEXTMENU
I are Troll
|
|
|
|
|
Do U know why that won't work?
Tip: the key word is HANDLE.
The question: Does WM_CONTEXTMENU has a handle?
The answer: Yes.
Another question: What handle?
|
|
|
|
|
P$YCH0 wrote: Another question: What handle?
Would the one mentioned here[^] work?
I are Troll
|
|
|
|
|
Yes it works and works quite well, It would work much better if you would try it.
F*** sake! Man, try it in your project first. Do you think YOU ARE the one at univers who can read talmud MSDN?
Do u realy think so?
P.S. You know, there's a SPY++... Try to start learning this tool it helps to prevent forum from sh*t, mf-expert
|
|
|
|
|
There really is no need for this kind of response. Eddy has made a perfectly reasonable suggestion to try and help you. If you cannot be bothered to go and investigate whether it will help then that is your problem.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
P$YCH0 wrote: Man, try it in your project first.
My projects don't require extending the system's default menu, I usually put in a new one. Cut, copy, paste and delete are easily added.
I don't have VB6 installed on my machine, and I doubt that openSuse would like it. Further, I doubt that it would be worth the time invested, compared to the added functionality. Yes, there are some 3rd party tools that integrate with every textbox, and they don't show up when you create something from scratch. Is that the reason of this exercise?
P$YCH0 wrote: Do you think YOU ARE the one at univers who can read talmud MSDN?
I think that most people have more important things to do than meditate on MSDN[^]
P$YCH0 wrote: Try to start learning this tool it helps to prevent forum from sh*t, mf-expert
You're gonna go far kid
I are Troll
|
|
|
|
|
Hate mfs who spit a bulshit! Don't be one of them! OK!
Man, what a f*** you wrote here? What a SUSE? What a 3d party tools? Are you crazy? Do you think it usefull? It's long time you keep silent, right? Wanna say something?
WHY YOU ARE ALL insted of direct answer "Yes, do this way..." or "No! It's impossible" trying to spit sh*t? Ah?
Please, excuse me for my impertinent words. I tired of useless advises.
... and i found the solution, relax
|
|
|
|
|
If you believe that this sort of language and attitude is going to get you help in the future you are likely to be sadly disappointed.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Here[^] is the VB6 reference for the TextBox , but I cannot see any property or method that offers what you want. However, VB6 is very old now and I don't think there is much support for it from Microsoft so you may find that there is no answer to your query.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Richard MacCutchan wrote: but I cannot see any property or method that offers what you want
U R right.
But let me ask you... How the context menu appears in textbox? We both know that there's no magic in real life
|
|
|
|
|
I c there's no anyone who helps me, it's a pity.
|
|
|
|