|
Thanks Dave. That did it. I removed the names space which was causing and conflict. It now works.
It is VB. I hate languages that are case sensitive.
|
|
|
|
|
I have designed a keyboard using vb.net but this keyboard is typing only in my application textbox.when i open notepad and press the buttons in my application the character is not displayed in notepad
and it is displayed only in my textbox.But "windows" onscreenKeyboard is doing correctly.Is there Any suggestions To solve This Problem.......
Here Is The Code:-
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text + "A" 'Button 1 Is assigned With character A
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = TextBox1.Text + "B" 'Button 2 Is assigned With character B
End Sub
|
|
|
|
|
Iam using keypress event in vb.net and i have assingned values for some of the keys but when i press the key,the assigned value and the pressed keys value both are displayed in the screen.I am unable to solve this problem.Help me guys.............
If i press semicolon ";A" is displayed
Here Is the code:-
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) = 59 Then 'Ascii value of semi-colon
TextBox1.Text = TextBox1.Text + "A"
End If
If Asc(e.KeyChar) = 32 Then 'Ascii value of space Bar
TextBox1.Text = TextBox1.Text +"B"
End If
End Sub
modified 24-Sep-13 11:03am.
|
|
|
|
|
If you changed the text you need to set e.Handled to true so that the operating system doesn't process the character. You would put this statement inside your if's.
|
|
|
|
|
Ya It Worked Nicely.....
but my cursor is always at the starting point.i have pressed semi-colon for 9 times even then the cursor is at the starting point only and not moving to the end.
|
|
|
|
|
You should use AppendText and to make the carat move to the end you can do this:
If Asc(e.KeyChar) = 59 Then
TextBox1.AppendText("A")
TextBox1.SelectionStart = TextBox1.Text.Length
e.Handled = true
End If
|
|
|
|
|
It Worked Out Exactly
The Cursor Is Moving Along The Text But After Pressing "Semi-Colon" & "Space",I Moved The Cursor Between
"A & B" and again i Pressed "Semi-colon" but A Is Displayed At the End And Not Between A &B.
modified 25-Sep-13 11:40am.
|
|
|
|
|
If you want it to insert the character at the current carat position, do this:
If Asc(e.KeyChar) = 59 Then
Dim selPos as Integer = TextBox1.SelectionStart
TextBox1.Text = TextBox1.Text.Insert(selPos, "A")
TextBox1.SelectionStart = selPos + 1
e.Handled = true
End If
|
|
|
|
|
The Character Is Inserted Between them,but the scroll bar is automatically scrolling to the top of the page.
|
|
|
|
|
...
If Asc(e.KeyChar) = 59 Then
Dim selPos as Integer = TextBox1.SelectionStart
TextBox1.Text = TextBox1.Text.Insert(selPos, "A")
TextBox1.SelectionStart = selPos + 1
TextBox1.ScrollToCaret()
e.Handled = true
End If
This may cause the scroll position of the textbox to change, this is unavoidable without using some interop methods to scroll back to exactly the same position. The ScrollToCaret only ensures that the caret is positioned in the visible region of the control.
|
|
|
|
|
can anyone post a code which can not be uninstalled when the program is running by C# custom install option
|
|
|
|
|
There is no way to stop uninstallation of a program. You can write on the drive, registry etc, but a file can still be uninstalling by deleting these entries.
|
|
|
|
|
For some domain smtp is working fine but for some emails its showing Mailbox unavailable. The server response was: <xyz@testdomain.com>, Recipient unknown .
Please could any one able to help me . Its urgent.
Thanks in advance.
|
|
|
|
|
I'm not sure what you want us to help you with. When you get the message "Recipient unknown", it's telling you that the email address you're trying to send the email to doesn't exist or that there's a problem with the recipient configuration that prevents you getting access to them. As this is a problem, effectively, at their end there's not a lot you can do.
|
|
|
|
|
My problem is only that some users are not receiving emails because for them its showing error(Recipient unknown)and rest are receiving the emails.
Is there is any way that they also start getting the emails.
|
|
|
|
|
Go and ask them to check. The only thing you can do is to ask them to verify their email address.
Veni, vidi, abiit domum
|
|
|
|
|
Guys I have made a convertor that converts a decimal number to a octal number in VB.NET,but it converts only upto 7 digits of decimal number to Octal.If it exceeds 7 digits "Memory Overflow" message is displayed.How To solve this problem guys?
Here Is The Code:
Dim s1,s2 As string
Dim i1,i2 As Integer
s1=textbox1.Text
i1=Convert.ToInt64(s1, 10)
s2=Convert.ToString(i1, 8)
i2=Convert.ToInt64(s2, 8)
but this code is limited only up to 7 characters of input.
modified 24-Sep-13 11:01am.
|
|
|
|
|
Well look at these two lines:
Dim i1, i2 As Integer
i1 = Convert.ToInt64(s1, 10)
What is happening here is that you are sticking an Int64 into an Integer. It can handle a certain number of "characters" (actually numbers) because after that number it overflows. You need to declare i1 and i2 as something that can hold large numbers, something like maybe Int64... Integer is an Int32 by default.
|
|
|
|
|
Any Other Solutions Or Suggestions,To solve this problem.....
|
|
|
|
|
Why? Did you try what I said and it did not work?
|
|
|
|
|
S you are right,i have changed it from "ToInt64" to "ToDouble"
but,it is converting now upto 9 characters only...........
|
|
|
|
|
Please post the code you changed like you did in the first post.
|
|
|
|
|
Here Is The code:-
Dim s1,s2 As string
Dim i1,i2 As Integer
s1=textbox1.Text
i1=Convert.Todouble(s1)
s2=Convert.ToString(i1, 8)
i2=Convert.Todouble(s2)
but It is limited only up to 9 characters.....
|
|
|
|
|
This is exactly the same problem...
Double is 64 bit, integer is 32 bit. You need to declare i1 and i2 as double's if you want to use ToDouble.
|
|
|
|
|
So here I am again. Something that should be easy is not.
I created a usercontrol (button_fancy). It works and all, but in the designer after I add my usercontrol, If I dbl click it generates a load event, All other controls generate a click event by default.
Of course I can just single click it and go to the event properties and create a click event. But how do I get the designer to default the click event?
Bonus question,
In the control I have a propery "mytext" I wanted to be consistant and have a property "Text". However that does not work. What little trick does it take to override a unexposed property?
Highflier
|
|
|
|