|
Well, I can't give you the code, b/c I don't own it, my work does. But rather than a bunch of code at the button level, what I did was find a single graphic of a keyboard, and created a map of rectangles that represented each key. On a mouse down event, I would iterate over those rects and find the one that contained the point. Then I'd look up what key that represented and go from there.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I already have pictuers for each button and i already did the layout
I tryed this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SendKeys.Send("W")
End Sub
and this
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Text = ("W")
End Sub
did not work
i put the curser in the text box and it go away when i click the buttin
|
|
|
|
|
Bob Beaubien wrote: i put the curser in the text box and it go away when i click the buttin
After the button click you can focus to text box which will bring the cursor back to it.
Bob Beaubien wrote: I already have pictuers for each button and i already did the layout
Putting each button for each key sounds like a terrible idea. Go with what CG suggested. That would be interesting and obvious solution here.
|
|
|
|
|
Bob Beaubien wrote: SendKeys.Send("W")
This is a nightmare. Make your control hold a reference to a textbox, and then add the character explicitly, not with sendkeys or other dodgy stuff.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am lots now hehe i am going have to do some more looking up
|
|
|
|
|
lost ? OK, well, you have a public property of type textbox. It gets set to whatever textbox has the focus. You do this by creating a derived class, which, when it gets the focus, passes itself to the static keyboard object. Then in your code, you use the text property of that control to insert the text.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Would making a custom IME helps?
The other way is go deep into Win32 API and lotsa hooking and hacking.
Pals of mine did the Tengo keyboard on tablets, though I am not so sure what did they used. I only did the Palm version, but I am sure the Windows Mobile version are in C++.
http://www.gadgetme.com/?view=1&showMore=2449[^]
|
|
|
|
|
Hello i have question how to make something like this : CIMDBSearch Class[^]
But in vb8 or .net ... Thanks for reply .
|
|
|
|
|
Apparently, his class created a URL according to IMDB's specifications and retrieved the movie page from the website. It then parsed the web page HTML to pull out the relevant information and filled in a search research object which is returned to the caller.
|
|
|
|
|
Thanks for reply , but i dont know how to code it .. Can you give me example pls ? Thank you
|
|
|
|
|
I don't have any examples that would be anywhere close to this. You just ahve to break down the problem into smaller units and work on each of those individually. Each one of these units is going to have an example somewhere. This is where you're most important skill as a programmer comes into play - the ability to do research and teach yourself new things. I've already told you the steps needed, it's up to you to break those down into smaller managable pieces and tech yourself the techniques of each.
|
|
|
|
|
The article has comments about it not working, so it probably isn't the best choice. However, the sequence of events is quite simple. Get the web page source, and apply a regex to it. The former is simple, the second needs some research. Try this website for help on that.
|
|
|
|
|
Thanks for reply , but i dont know how to code it .. Can you send me example pls ? Thanks so much
|
|
|
|
|
No one will flat out do your work for you, perhaps you should pick up a book and give it a shot.
|
|
|
|
|
Ok its good idea , bud i am from Czech and books for vb in czech language ....
|
|
|
|
|
You still have to do your own work.
If you really want an application without doing the work (or paying for a pre-existing product) then go to rentacoder[^] and pay to have someone make it.
|
|
|
|
|
No. The code itself is quite simple - apart from the regular expression, so this shouldn't be too difficult. If you want somebody to do your work for you, become a manager.
|
|
|
|
|
I have successfully load a dynamic array reading the numbers in a text file into form. But how can I save that array again into text file after I change some numbers.
Private Sub LoadButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoadButton.Click
Dim lin(8) As String, filRead As StreamReader, i, x, t, d As Integer
Dim openFile As New OpenFileDialog()
openFile.Filter = "txt.Files(*.txt)|*.txt"
openFile.InitialDirectory = "\C:TextFile1.txt"
If openFile.ShowDialog() = DialogResult.OK Then
MessageBox.Show(openFile.FileName)
End If
filRead = New StreamReader(openFile.FileName)
'diff = CByte(filRead.ReadLine())
For r As Integer = 1 To 3
For rr As Integer = 1 To 3
lin = filRead.ReadLine.Split() : i = 0
For c As Integer = 1 To 3
For rc As Integer = 1 To 3
If lin(i) <> "00" Then
x = Integer.Parse(lin(i))
If x > 0 Then xx(r, c).rec(rr, rc).ForeColor = Color.Red
x = Abs(x)
xx(r, c).rec(rr, rc).Text = x.ToString
For j As Integer = CInt(Int(Log10(x))) To 0 Step -1
If j = 0 Then xx(r, c).val(rr, rc) = CByte(x)
t = CInt(10 ^ j)
d = x \ t : x = x Mod t
xx(r, c).yy(rr, rc, d) = True
Next
End If
i += 1
Next
Next
Next
Next
filRead.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
Dim lout(8) As String, filsave As Streamwriter, i, x, t, d As Integer
Dim saveFile As New SaveFileDialog()
saveFile.Filter = "txt.Files(*.txt)|*.txt"
If saveFile.ShowDialog() = DialogResult.OK Then
MessageBox.Show(saveFile.FileName)
End If
filsave = New StreamReader(saveFile.FileName)
For r As Integer = 1 To 3
For rr As Integer = 1 To 3
lout = filsave.
For c As Integer = 1 To 3
For rc As Integer = 1 To 3
If lout(i) <> "00" Then
x = Integer.Parse(lout(i))
If x > 0 Then xx(r, c).rec(rr, rc).ForeColor = Color.Red
x = Abs(x)
xx(r, c).rec(rr, rc).Text = x.ToString
For j As Integer = CInt(Int(Log10(x))) To 0 Step -1
If j = 0 Then xx(r, c).val(rr, rc) = CByte(x)
t = CInt(10 ^ j)
d = x \ t : x = x Mod t
xx(r, c).yy(rr, rc, d) = True
Next
End If
i += 1
Next
Next
Next
Next
saveFile.InitialDirectory = ""
filsave.Close()
End Sub
End Class
modified on Wednesday, September 16, 2009 10:08 PM
|
|
|
|
|
Loop the array, and write them to a file using a StreamWriter [^]
I are Troll
|
|
|
|
|
I have Idea how to look for next number but I need some help to put into vb 2008 code I am new to vb so please help me
Findnext(fromcell, fromvalue):boolean
• Result=false;
• Insert Fromvalue into Fromcell
• If Fromvalue is the last point (NxN) then set result=true and exit.
• Fromvalue not the last point:
o Set Nextvalue=Fromvalue+1,
o For each of the 4 directions check the neighbor (Nextcell)
Is Nextcell empty and Nextvalue not predefined?
Yes: Result=Findnext(.Nextpoint, Nextvalue)
No: If Nextcell already contains Nextval then this is a predefined number,
Result=Findnext(Nextcell,Nextval);
o end neighbor search loop
• if Result=False and Fromvalue was not predefined then set Fromcell abck to empty
Can please some one help me
Thank you
|
|
|
|
|
Help you with what? It looks like you've got all the logic worked out already, so I don't know what you need help with.
|
|
|
|
|
Hi all,
I want to get the files with different extensions in a directory.
I have written code, which searches the .pdf files and it does what is expected.
modified 28-Nov-12 7:57am.
|
|
|
|
|
You'd have to use three different GetFiles calls and add them to a List(Of). GetFiles doesn't take an argument that lets you specify multiple filespecs in a single call.
|
|
|
|
|
One easy solution is to call the GetFiles() for all of your extensions. The code cuold be something like:
Dim theFilesPDF As FileInfo() = theDir.GetFiles("*.pdf")
Dim theFilesTIF As FileInfo() = theDir.GetFiles("*.tif")
Dim theFilesDOC As FileInfo() = theDir.GetFiles("*.doc")
Dim theFilesXLS As FileInfo() = theDir.GetFiles("*.xls")
As a result you have 4 FileInfo arrays - 1 for each extension.
Regards
Nuri Ismail
modified on Wednesday, September 16, 2009 10:01 AM
|
|
|
|
|
Hi,
there are many ways to do this, I'll give you four of them.
1. The easiest one is also the most expensive: simply get all the files, not just PDF files, into your "theFiles" array, then filter them yourself inside the for loop using a composite IF statement (if pdf or tif or ... then ...). The drawback is it may take a lot of memory storing things you don't really want.
2. the next best thing would be to get four arrays theFiles0...theFiles3 and then either concatenate them, or organize an outer for loop that uses them one by one. This only stores filenames you are going to use.
3. then you could create your arrays one by one, as you are needing only one of them at a time. That would take an outer for loop like
Dim extensions as string()=new string(4)
... insert four extensions in array, then
For each extension as string in extensions
Dim theFiles As FileInfo() = theDir.GetFiles(extensions(extensionNumber))
...inner for loop
Next
4. And finally since .NET 3.5 there are new methods that improve upon Directory.GetFiles() by returning the next file, one by one, without requiring any array at all.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|