|
OK, so what part of this are you having a problem with?
Is it handling the SelectedItemChanged event of the ComboBox or setting the ReadOnly property of the TextBox to True?
|
|
|
|
|
setting the ReadOnly property of the TextBox to True?
|
|
|
|
|
Very simple:
myTextBox.ReadOnly = True
|
|
|
|
|
Use the SelectedIndexChanged event of the combobox, ComboBox.SelectedIndexChanged Event (System.Windows.Forms)[^]
And in that event check if combobox.SelectedItem = "rack" and if so set txtRam.ReadOnly= true.
Pretty simple.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
develop a project which provide following mode of transport and fares per unit distance .it should calculate the price for the travel distance.mode:railway=rs2 perkm,flight=rs100perkm,car = rs 5 per km.
|
|
|
|
|
|
|
Your homework should serve the purpose that you learn something. And that something is not how to get your homework done for you by someone else.
If you have a specific question while attempting to do your homework, feel free to ask. But we won't do it all for you.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Ok. I've done that. Now what?
|
|
|
|
|
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
You lose. Simon didn't say.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
hi...
need help on urgent basis.
i wanna make a graph for my few excel files containing different datas . unable to get the code how to call those excel files for making graphs..
thanks for your help in advance..
|
|
|
|
|
|
I'm programming for my G15 LCD Keyboard.
When i press a button on the LCD it triggers the "ButtonPressed" event. When i press button 2 i want it to Add Handlers for my KeyboardHook for my Calculator.
The idea is that when i press button 2, my screen changes and my KeyboordHook starts listening, then i can enter calculations on my keyboard that are displayed on my LCD and processed when i hit enter.. Simple enough..
The problem is that i can't seem to find a way to add the Handlers for it while i'm already in an event..
The ButtonPress Event that starts the Calculator:
Dim Calculator As New Tools.LCDCalculator
Public Function ButtonPress(ByVal device As Integer, ByVal dwButtons As Integer, ByVal pContext As System.IntPtr) As Integer
Calculator.StartCalculator()
End Function
And here's the Calculator Class:
Public Class LCDCalculator
Public Active As Boolean
Public Sub StartCalculator()
Debug.WriteLine("Active")
AddHandler HookManager.KeyPress, AddressOf HookManager_KeyPress
End Sub
Public Sub StopCalculator()
Debug.WriteLine("Inactive")
RemoveHandler HookManager.KeyPress, AddressOf HookManager_KeyPress
End Sub
Public Sub HookManager_KeyPress(sender As Object, e As KeyPressEventArgs)
Debug.WriteLine(String.Format("KeyPress - {0}", e.KeyChar))
e.Handled = True
End Sub
End Class
I thought it might be threading or something so i tried doing this:
Task.Run(Sub() Calculator.StopCalculator())
But no such luck ...
I can start the Calculator from anywhere else and it works flawlessly, but when i try adding that handler from in the ButtonPress event it doesn't seem to work..
Please advise
|
|
|
|
|
Being inside and event handler has no bearing at all on the ability to add or remove event handlers.
The problem lies elsewhere, though I can't say where because there is insufficient code and description of how you have things setup. For example, does the KeyboardHook work in a test application?
|
|
|
|
|
I am building a windows form, using VB in VS2015.
I have a number of objects on the form. I added MSFlexGrid. Clicked F4 to edit properties, changing name, number of rows and columns.
The MsFlexgrid object then displays as a dotted box. If I try clicking on it it disappears.
I thought it might have been because I picked one column and two rows, so I have tried different number of rows and columns, no difference.
Anyone else had this problem and know the fix please ?
Thanks for reading
|
|
|
|
|
Why are you even using the FlexGrid? It's older than dirt itself. The modern replacement is the DataGridView.
|
|
|
|
|
Because I'm converting a VB5 project.
|
|
|
|
|
That is not any reason to use a COM object that is truly ancient. Replace it with a datagridview and be done with it.
The up side is there are plenty of examples on how to use a DGV.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you - what you say makes sense. Are there any tips you can allude to on converting to the new version please ?
|
|
|
|
|
Not really, I would probably search here for some DGV examples and download the article code and work through binding the data to the DGV.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'll give that a go, in a test project I am running, before using on live one. Do you know of any things the new one won't do that the old version would do ? I can't imagine a problem because the use was quite simple, but .....
|
|
|
|
|
No.
Honestly, I haven't used the old one in so long I can't even remember what it looks like.
The differences between the old VB5 and VB.NET are so huge they really are different languages. I would not be doing a line-by-line conversion of the app. I'd be scrapping the old code and completely rewriting from the ground up. You'll probably find that you'll be using less code too.
|
|
|
|
|
I am running into the issue:Access Denied when calling bcp from Windows 2012 server.
Any idea what it could be? Running in elevated mode.
Dim ps As New System.Diagnostics.Process
ps.StartInfo.UseShellExecute = False
ps.StartInfo.Domain = Domain
ps.StartInfo.UserName = UserName
Dim pword As New System.Security.SecureString()
For Each c As Char In Password
pword.AppendChar(c)
Next
ps.StartInfo.Password = pword
ps.StartInfo.LoadUserProfile = False
ps.StartInfo.WorkingDirectory = "E:\"
ps.StartInfo.FileName = "cmd.exe"
ps.StartInfo.Verb = "runas"
ps.StartInfo.Arguments = " bcp " + DbTable + " in " + SourceFile + " -m " + MaxErrors + " -f " & FMTFile & " -e " & ErrorFile & " -o " & LogFile & " -S " & ServerName & " -T"
ps.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
ps.Start()
ps.WaitForExit()
|
|
|
|
|
First, you don't need the RunAs verb line at all.
Next, the command line you build is this:
cmd bcp something in something -m ...
That command line is wrong for CMD.
Next, you don't even run CMD. Your Filename line should be "bcp". The Arguments should be almost everything you already have in existing statement.
ps.StartInfo.FileName = "bcp"
ps.StartInfo.Arguments = String.Format("{0} in {1} -m {2} -f {3}...", DbTable, SourceFile, MaxErrors, FMTFile, ...
ps.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
ps.Start()
ps.WiatForExit()
On top of everything else, in order for the Hidden window option to work you have to change the UseShellExecute property to True.
|
|
|
|