|
Yep. That's it
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I need to re-select the current record after a user clicks a column header to do a sort. This needs to be done after the sort. All of the references I have found say to add a handler for the DefaultView.ListChanged. I have done this, but I don't get the ListChanged event they say I should get when the user clicks the column header and the sort is performed. I have tried using the mouse up/down events but the sort is not performed until after the mouse button is released. I need to do something after the sort. Am I doing something wrong? This is the code I use for the handler.
AddHandler dsInvoice.Tables("Invoice").DefaultView.ListChanged, AddressOf onListChanged
|
|
|
|
|
I'm trying to validate a textbox with only a...z and spaces. I can validate a...z with Keypress but how do I validate a space?
Nosiller
|
|
|
|
|
The SPACE character has an ASCII code of 32. Cast the KeyChar property of your KeyPressEventArgs object to an int and check whether its value is 32.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thank you very much. I will give it a try.
Nosiller
|
|
|
|
|
how about e.KeyChar.CompareTo(" "c) ?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I would always use Keys.Space, and not a space or ASCII code. I would use char.isalpha to test against a-z, also.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
another technique:
Private Sub Txt_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Txt.KeyPress
If Char.IsLetter(e.KeyChar) OrElse Asc(e.KeyChar) = Keys.Space Then
'allow
Else
e.Handled = True
End If
End Sub
|
|
|
|
|
I am using VS 2005 .NET 2.0
I have added a application config file, which contains 2 keys for my application. The config file named appTextSearch.config is created in my application's folder.
Now, the problem is I am not able to read these 2 values from the config file.
serverDetails (see below) returns nothing
ConfigurationManager.AppSettings.HasKeys also returns false
DO I need to specify anywhere in my application to read this application config file ?
</configuration>
<appSettings>
<add key="servername" value="http://a2tmon963:9080/gisgazetteerhttp/addressformatted.do?freeText=" />
<add key="recno" value="30" />
</appSettings>
</configuration>
Dim serverDetails As String = ConfigurationManager.AppSettings("servername")
Dim NoToReturn As String = ConfigurationManager.AppSettings("recno")
|
|
|
|
|
There shouldn't be a "/" in the first <configuration>
|
|
|
|
|
Sorry this was a typo. There is no "/" in the first configuration
|
|
|
|
|
It works fine for me then. Do you have a reference to System.Configuration in your Project?
|
|
|
|
|
I do have a reference to System.Configuration
To clarify, I am working with a class library DLL. I realise this is probably why I cannot read the app.config. Does anyone know any way around this problem ??
|
|
|
|
|
Use the following XML:
</configuration>
<appSettings>
<key>"servername"</key>
<value>"http://a2tmon963:9080/gisgazetteerhttp/addressformatted.do?freeText=" </value>
</appSettings>
<appSettings>
<key>"recno"</key>
<value>"30"</value>
</appSettings>
</configuration>
|
|
|
|
|
Hello,
I am looking for a solution to use like we had in VB 6 a Command control array.
I need to put +- 20 commandbuttons on a form with the same program code.
The buttons need to have all a different text coming out of a database. The color of every button is can be different to set also out of a data base.
It is for a hotel registration so i need to show the room nrs each on every button , when the room is occupied the button need to be red otherwise green. After clicking on a room nr the bill of that room comes up ,........
I just dont know how i can have a control array like in VB6.
Any suggestions are most welcome.
Thanks
Didier
|
|
|
|
|
There are many solutions Here:[^]
|
|
|
|
|
|
Thanx to everybody that has given me a link to the solution.
It works.
Thanks
Didier
|
|
|
|
|
Hi , I try to start a Shell application using Process, I give the rigth path but i beleive
Source code
Dim compiler As New Process
compiler.StartInfo = New ProcessStartInfo()
compiler.StartInfo.WorkingDirectory = "C:\Program Files\Firebird\Firebird_1_5\bin\"
compiler.StartInfo.FileName = ("gbak.exe")
compiler.StartInfo.Arguments = " -g -b -z -v ""C:\GDBCreation\SV1020_012Br21.GBB"" ""C:\GDBCreation\SV1020_012Br21.Data"" -user ""SYSDBA"" -password "" poupi"""
compiler.StartInfo.UseShellExecute = False
compiler.StartInfo.RedirectStandardOutput = True
compiler.Start()
Console.WriteLine(compiler.StandardOutput.ReadToEnd())
when i execute nothing happen, the console appear for one seconde and desapear.
Help me
|
|
|
|
|
there are one or two problems:
1.
fritzdjam wrote: compiler.StartInfo.Arguments = " -g -b -z -v ""C:\GDBCreation...
if you need to have a literal double quote, you would need to write \" inside
your literal string
2.
Process.Start() launches a process but does not wait for it to finish (not even to start);
so it tries and reads the results immediately, and finds none. You must wait before calling
ReadToEnd(), using one of WaitForInputIdle, WaitForExit, or HasExited.
Read up on the Process class!
-- modified at 11:35 Friday 23rd November, 2007
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: 1.
fritzdjam wrote:
compiler.StartInfo.Arguments = " -g -b -z -v ""C:\GDBCreation...
if you need to have a literal double quote, you would need to write \" inside
your literal string
Not true in VB.NET. VB doesn't support the \ character as an escape character. He has to use two double-quotes to get one inside the string.
|
|
|
|
|
Sure. I keep forgetting that. Maybe I should actually write some VB lines as a penitence?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Nah. I'll just take a rewrite of Notepad using LOGO.
|
|
|
|
|
You're so cruel.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|