|
You need to specify what you're writing the UI in. Is it WPF? Windows Forms? ASP.NET WebForms? Something else?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Private Sub Textbox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Textbox1.KeyDown
If e.KeyCode = Keys.Enter Then
Textbox2.Focus()
End If
End Sub
|
|
|
|
|
Hello everybody,
I've been struggeling with a Regex for hours now, and I hope someone of you can help me out of this. I'm trying to capture a "Number" section and a "Text" section from a string like
124[HT][HT]In the year 1560, there was ...[CR][HT][HT]somethingt strange going on.[CR][CR]125[HT][HT]The same pattern followed hour after hour. I've been trying dozens of different ways in Expresso, but nothing seems to work out.
(?<Nummer>\d+)\t+(?<Text>.*(?=\r{2,})) Mostly I get results having the first number in the proper section, but the complete rest of the string in only one "Text" section. What's my stupid error here? Somehow I'm lost in a maze now.
Thank you for your time!
Mick
|
|
|
|
|
This seems to work for your example input:
(?<number>\d+)\t+(?<text>[^\r\n]+((\r\n|\r|\n)\t+[^\r\n]+)*)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you for your great help, Richard - I guess my major misunderstanding was that I interpreted the [CR] as \r only, and not as \r\n? Nevertheless, it seems to work on the original, too.
Have a nice evening,
Mick
|
|
|
|
|
rs.Open "select PDATE,plan,NAME,PQNTY from purch where pdate >=" & DTPicker1.Value & " and pdate<=" & DTPicker2.Value & " order by name,pdate ", cn, adOpenKeyset, adLockOptimistic
what Wrong in above ?
in this command rs # 0 ?
rs.Open "select PDATE,plan,NAME,PQNTY from purch order by name,pdate", cn, adOpenKeyset, adLockOptimistic
rs.Filter = "pdate>=" & DTPicker1.Value & " and pdate<=" & DTPicker2.Value
what Difference
modified 8-Jul-13 2:12am.
|
|
|
|
|
Please do not post the same question multiple times like this. If you need to add extra information you can edit the original. As to your actual problem, it is not clear what you are asking.
Use the best guess
|
|
|
|
|
Could you delete your two other questions that is exactly simular?
|
|
|
|
|
Ajay Chaturvedi bhopal wrote: what Difference Your question is not clear, please expalin exactly what this code is supposed to do and what results you are getting.
Use the best guess
|
|
|
|
|
if i use this :-
rs.Open "select PDATE,plan,NAME,PQNTY from purch where pdate>=" & DTPicker1.Value & " and pdate<=" & DTPicker2.Value & " order by name,pdate", cn, adOpenKeyset, adLockOptimistic
no any record found and rs = 0 but if i use this
rs.Open "select PDATE,plan,NAME,PQNTY from purch order by name,pdate ", cn, adOpenKeyset, adLockOptimistic
rs.Filter = "pdate>=" & DTPicker1.Value & " and pdate<=" & DTPicker2.Value
then get records in rs, Why above side command not run.
|
|
|
|
|
Drop the string concatenation garbage for building this SQL statement and use parameterized queries instead. They will escape and translate your DateTime values properly. You don't mention what database you're using but what you've written really doesn't work for any database I know of.
And this looks like VB6 code. Why on earth anyone doing is still doing new VB6 developement in this day is beyond me. VB6 is long since dead.
|
|
|
|
|
Hi guys,
I've read articles about; "Sending and receiving data from RS232 or USB ports" or, "Using vb.net to switch on/off electrical devices", but conversely in my case I want to just using a simple electrical switch to do something in my vb.net application (via RS232 or USB port). For example; if user pushed an electrical switch button which is connected to the RS232 or USB port, then simply a text same as "Pushed" appear in my application's text box.
Briefly, could we connect an electrical switch without any circuit or board to USB port to do something simple in our application?
Any suggestion or experience?
Thanks.
|
|
|
|
|
Short answer: No.
Longer answer: you would need some interface between the switch and the computer's port that converted the elctrical current into the correct signals for the computer. Try searching Google for computer switches to see the sort of devices that are asvailable.
Use the best guess
|
|
|
|
|
|
aeskan wrote: Briefly, could we connect an electrical switch without any circuit or board to USB port to do something simple in our application? No, as a USB port doesn't know how to interpret a "row" of switches. There's various projects, with prebuild general-purpose controllers and open source to control the hardware, like this one[^]. Alternatively, find a cheap USB-joystick and a large hammer
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thank you Eddy for reply.
|
|
|
|
|
Connect a switch to a USB "port", hit the switch just once and you'll short the USB out and possibly kill the USB controller on your motherboard.
USB ports are not "ports". USB is a BUS, not unlike the expansion slots (bus) inside your PC. Without an interface chip on the switch to tell USB that a device is there, you cannot listen for the changes in the switch.
|
|
|
|
|
|
As other have already pointed out. Direct connection to USB is hazardous to the health of the USB ports.
However, perhaps if you got hold of a USB-Serial adapter it should be possible to use it on the Carrier Detect/CTS/RTS/DTR/DTS. whichever is available at the serial port.
an additional smoothing capacitor & resistor above 1K-ohms in series should help filter out the switching noise/limit current demand.
|
|
|
|
|
Thank you dusty_dex, that's what I was searching for.
|
|
|
|
|
Hi again.
I am a little confused about setting up delegates. I believe this is correct:
If I have a number of individual statements such as:
MyLocalTreeView.TreeView1.SelectedNode.Parent.FullPath
MyLocalTreeView.TreeView1.SelectedNode.FullPath
MyLocalTreeView.TreeView1.SelectedNode.Expand()
Me.MyLocalTreeView.TreeView1.Focus()
am I correct in assuming that separate delegates for each must be built, if they do not all happen together in some recurring usage where they would all be lumped together in one sub?
Thanks for your help!
|
|
|
|
|
Are you using the term "delegate" correctly? Delegates are basically function pointers that can be passed around like variables. In VB.NET delegates are created using the AddressOf operator. See this: Delegates in VB.NET[^]
Maybe I'm not getting what you are trying to do? Are you talking about a subroutine to do all the above operations in one call?
|
|
|
|
|
Hi, Ron. Thanks for your response.
I am referring to the fact that a form's controls cannot be directly accessed via a thread other than the main thread that runs the form itself. Delegates are required. That being the case, if I have a TreeView that must be updated from a second thread, do I need to create separate delegates for each and every method I will use for the TreeView? It seems that unless I always use multiple TreeView methods in a set order, and put all of that into a sub that will have a delegate assigned to it, then I will need to do them all separately.
Hm...just thought of this...Unless it is possible to create a delegate for the entire TreeView class.
|
|
|
|
|
Yeah, "delegate" is not the right term.
Operations on UI items can only be performed on the thread that created them, typically (almost always) the UI thread. When you want to do something, you have to Invoke on the UI thread. Don't confuse the word invoke with delegates, a delegate can be invoked, but its really not the same concept. You can create a delegate to invoke on the UI, but there are other options.
The Control.Invoke method invokes on the UI thread, you don't have to use the TreeView.Invoke for just treeview items, you can update any UI item in that invoke call since its running in the UI thread. You can even run complicated sets of code in there if you want that have nothing to do with the UI.
|
|
|
|
|
Ah, cool. Thanks for the clarification. I think you just made my day in getting my mind around delegates and Invoke, and how they relate.
|
|
|
|