Damage variable
-
i send a vairable to another application but some time the variable damage and add some thing diffrent ... i dont know why ... for example : dim s as string ="4294:DN" windows.minimaiz send.sendwait("s")/ print in active window windows.maximize the problem the first time print the s as 4294:DN on the another window but aftet repeat the action of print the variable will print some thing deffirent like 44294:::DN why the variable change ?????????? kilany
-
i send a vairable to another application but some time the variable damage and add some thing diffrent ... i dont know why ... for example : dim s as string ="4294:DN" windows.minimaiz send.sendwait("s")/ print in active window windows.maximize the problem the first time print the s as 4294:DN on the another window but aftet repeat the action of print the variable will print some thing deffirent like 44294:::DN why the variable change ?????????? kilany
Mr kilany wrote:
i send a vairable to another application
How are you doing this? There's only about a dozen different ways... Dave Kreskowiak Microsoft MVP - Visual Basic
-
Mr kilany wrote:
i send a vairable to another application
How are you doing this? There's only about a dozen different ways... Dave Kreskowiak Microsoft MVP - Visual Basic
i send variable by this fuction dim ss as string = textbox1.text // here imagen i put "2415666:" /// here code whcih minimaze the form of vb.net System.Windows.Forms.SendKeys.SendWait("ss")// here the code which different and change . and after many click of button which make this action the string will print as "245566654" or some thing wrong .. the question why the variable printed like this .... ///here code whcih minimaze the form of vb.net kilany
-
i send variable by this fuction dim ss as string = textbox1.text // here imagen i put "2415666:" /// here code whcih minimaze the form of vb.net System.Windows.Forms.SendKeys.SendWait("ss")// here the code which different and change . and after many click of button which make this action the string will print as "245566654" or some thing wrong .. the question why the variable printed like this .... ///here code whcih minimaze the form of vb.net kilany
Copy and paste the ACTUAL code, don't retype it here. What your saying is happening is impossible from the code that you've posted. Dave Kreskowiak Microsoft MVP - Visual Basic
-
Copy and paste the ACTUAL code, don't retype it here. What your saying is happening is impossible from the code that you've posted. Dave Kreskowiak Microsoft MVP - Visual Basic
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Try Dim cone As New Conection Dim ii As Integer = ds.Tables(0).Rows(ComboBox1.SelectedIndex).Item(0) Dim sh As String = cone.get_Special_data("select Switch_Access_Code from Swiches where Swich_ID=" & ii & "") b2 = "" b2 = sh Me.WindowState = FormWindowState.Minimized System.Windows.Forms.SendKeys.SendWait(b2)//b2="2494:" come from //database on sql server Me.WindowState = FormWindowState.Normal b2 = "" Catch ex As Exception MsgBox("الرجاء اختيار القسم") End Try End Sub some times when i click on this button will type on active window 4294: but aslo some time type 44294: and some time 4294:: and some time 4294: and some time 4449942: althought the data which comes from data base is just 4294: why the variable b2 some time print wrong data not as want ??????? kilany
-
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Try Dim cone As New Conection Dim ii As Integer = ds.Tables(0).Rows(ComboBox1.SelectedIndex).Item(0) Dim sh As String = cone.get_Special_data("select Switch_Access_Code from Swiches where Swich_ID=" & ii & "") b2 = "" b2 = sh Me.WindowState = FormWindowState.Minimized System.Windows.Forms.SendKeys.SendWait(b2)//b2="2494:" come from //database on sql server Me.WindowState = FormWindowState.Normal b2 = "" Catch ex As Exception MsgBox("الرجاء اختيار القسم") End Try End Sub some times when i click on this button will type on active window 4294: but aslo some time type 44294: and some time 4294:: and some time 4294: and some time 4449942: althought the data which comes from data base is just 4294: why the variable b2 some time print wrong data not as want ??????? kilany
Don't make me repeat myself.... The problem is not the variable, but the method in which your code is TYPING it into the other application. I just got done telling you that you've chosen, possibly, the worst method to pass data to another application. SendKeys is NOT guaranteed to put the data into that TextBox exactly as sent. This is because SendKeys cannot control how the keystrokes you're sending are processed by the other app. Dave Kreskowiak Microsoft MVP - Visual Basic
-
Don't make me repeat myself.... The problem is not the variable, but the method in which your code is TYPING it into the other application. I just got done telling you that you've chosen, possibly, the worst method to pass data to another application. SendKeys is NOT guaranteed to put the data into that TextBox exactly as sent. This is because SendKeys cannot control how the keystrokes you're sending are processed by the other app. Dave Kreskowiak Microsoft MVP - Visual Basic
-
Dear. sorry ... but can you give me a best method which pass data to another application ... really i need to use it ...and the way to use it ? kilany
The best method is if the other application exposes a COM object model to use. Other that that, the possibilities get very complicated. If you're putting text into a TextBox, then you could find a way to get the window handle of the target window and use WM_SETTEXT to fill in the TextBox. Google for "WM_SETTEXT FindWindow" and you'll come up with some examples. Dave Kreskowiak Microsoft MVP - Visual Basic
-
The best method is if the other application exposes a COM object model to use. Other that that, the possibilities get very complicated. If you're putting text into a TextBox, then you could find a way to get the window handle of the target window and use WM_SETTEXT to fill in the TextBox. Google for "WM_SETTEXT FindWindow" and you'll come up with some examples. Dave Kreskowiak Microsoft MVP - Visual Basic
i dont need to write in note pade and the another application read from it. i need to use the sendwait() method but the problem what happed ? really i dont know maybe i shoudl add timer to the button action to slow down the transfer of data from vb.net to another application ..so i need the solution .. because i work with seminar project and i have a 1/5 as a dead date .. the problem is transfer a data from vb.net to another application without any changes of data.. please i send more than 12 to get the answer but still at this moment without a correct soluation...please help me. kilany
-
i dont need to write in note pade and the another application read from it. i need to use the sendwait() method but the problem what happed ? really i dont know maybe i shoudl add timer to the button action to slow down the transfer of data from vb.net to another application ..so i need the solution .. because i work with seminar project and i have a 1/5 as a dead date .. the problem is transfer a data from vb.net to another application without any changes of data.. please i send more than 12 to get the answer but still at this moment without a correct soluation...please help me. kilany
No matter what, SendKeys cannot control how the destination application processes the keys sent to it. You can slow it down using a Timer, but I seriously doubt that it'll do you any good. If you really want to use SendKeys, you'll have to pay VERY close attention to how you other application behaves and how each control behaves when it gets the focus from your app. Then you'll have to modify the key string you send to account for being in the wrong control or to make sure the focus is in the correct control and the insertion point is in the correct position before you send any data. Even then, you can't guarantee accurate results. This is because ANY keystroke or mouse click anywhere on the screen during the SendKeys command, or before the target app processes the keystrokes can seriously screw up what you sent. The bottom line is there is NO RELIABLE METHOD TO DO THIS!! Dave Kreskowiak Microsoft MVP - Visual Basic