|
hii all i need some one to give me any refrencce or books to learn ho can i use or control for serial port i hope the book with arabic language plz
|
|
|
|
|
i use a component MSCOMM for serial ports.
in this i need to pass all settings of device.
and its generates a txt file, i use that file to get the specifc data
i think should try this kind of thing
bye
Thanks,
Ankur Bakliwal
|
|
|
|
|
I am trying top disable a groupbox through code. Can someone please help? Here is some code to see what I am trying to do. I want to disable the groupbox where you see the code GroupBox1.Enabled = False. This does not work, any ideas?
Dim message As DialogResult
'Confirm deletion of rows from table in database
message = MessageBox.Show("Do you want to delete old data?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If message = Windows.Forms.DialogResult.Yes Then
DeleteQuery()
ElseIf message = Windows.Forms.DialogResult.No Then
MessageBox.Show("Since old data is not deleted you may encounter scanning issues. Are you sure you want to keep old data?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
If message = Windows.Forms.DialogResult.Yes Then
GroupBox1.Enabled = False
ElseIf message = Windows.Forms.DialogResult.No Then
DeleteQuery()
End If
End If
jds1207
|
|
|
|
|
You never set your message value again for the 2nd messagebox.
Cleako
|
|
|
|
|
GroupBox1.Enabled = False will disable a groupbox. That code works just fine. The problem is it never runs. The groupbox get's disabled if the user clicked yes. However that if statement is located within an another if statement that only executes if the user pressed no. The user can't press no and yes. When in doubt add stops to your code so you can tell if code is being executed.
|
|
|
|
|
Hi I wrote a VB code for automatic date picker,I need to convert the same to Javascript inorder to embbed the same into Infopath.Can you please me in this.Below is the VB code.
Private Sub Cmd_Timer_Click()
Dim a As String
Dim b As Date
b = DTPicker1
'a = day(DTPicker1)
'MsgBox a
If Combo1.Text = Label4.Caption Then
Text1.Text = DTPicker1 + 1
DTPicker1 = Text1.Text
a = Format$(DTPicker1, "dddd")
If a = "Sunday" Then
DTPicker1 = DTPicker1 + 1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
Else
If a = "Saturday" Then
DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
End If
End If
DTPicker1 = b
Exit Sub
End If
If Combo1.Text = Label5.Caption Then
Text1.Text = DTPicker1 + 2
DTPicker1 = Text1.Text
a = Format$(DTPicker1, "dddd")
If a = "Sunday" Then
DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
Else
If a = "Saturday" Then
DTPicker1 = DTPicker1 + 3
'Text1.Text = DTPicker1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
End If
'Text1.Text = DTPicker1 + Text2.Text
End If
DTPicker1 = b
Exit Sub
End If
If Combo1.Text = Label6.Caption Then
For i = 1 To Text2.Text
a = Format$(DTPicker1 + i, "dddd")
If a = "Sunday" Then
DTPicker1 = DTPicker1 + 1
'Text1.Text = DTPicker1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
Else
If a = "Saturday" Then
DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
End If
End If
Next i
'Text1.Text = Format(DTPicker1, "MM/DD/YYYY") + Text2.Text
Text1.Text = Format(DTPicker1 + Text2.Text, "MM/DD/YYYY")
DTPicker1 = b
Exit Sub
End If
If Combo1.Text = Label7.Caption Then
Text1.Text = Format(DTPicker1, "MM/DD/YYYY")
End If
'DTPicker1 = Text1.Text
'a = Format$(DTPicker1, "dddd")
'If a = "Sunday" Then
'DTPicker1 = DTPicker1 + 1
'Text1.Text = DTPicker1
'Else
'If a = "Saturday" Then
'DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
'End If
'End If
End Sub
Private Sub Combo1_click()
'Label4.Caption = Combo1.Text
If Combo1.Text = "3(User Defined)" Then
Text2.Visible = True
Else
Text2.Visible = False
End If
'Dim a As String
'Dim b As Date
'b = DTPicker1
'
''a = day(DTPicker1)
''MsgBox a
'
'If Combo1.Text = 1 Then
'Text1.Text = DTPicker1 + 1
'DTPicker1 = Text1.Text
'a = Format$(DTPicker1, "dddd")
'If a = "Sunday" Then
'DTPicker1 = DTPicker1 + 1
'Text1.Text = DTPicker1
'Else
'If a = "Saturday" Then
'DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
'End If
'End If
'End If
'If Combo1.Text = 2 Then
'Text1.Text = DTPicker1 + 2
'DTPicker1 = Text1.Text
'a = Format$(DTPicker1, "dddd")
'If a = "Sunday" Then
'DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
'Else
'If a = "Saturday" Then
'DTPicker1 = DTPicker1 + 3
'Text1.Text = DTPicker1
'End If
''Text1.Text = DTPicker1 + Text2.Text
'End If
'End If
'If Combo1.Text = 3 Then
'For i = 1 To Text2.Text
'a = Format$(DTPicker1 + i, "dddd")
'If a = "Sunday" Then
'DTPicker1 = DTPicker1 + 1
'Text1.Text = DTPicker1
'Else
'If a = "Saturday" Then
'DTPicker1 = DTPicker1 + 2
'Text1.Text = DTPicker1
'End If
'End If
'
'Next i
'Text1.Text = DTPicker1 + Text2.Text
'End If
'
''DTPicker1 = Text1.Text
''a = Format$(DTPicker1, "dddd")
''If a = "Sunday" Then
''DTPicker1 = DTPicker1 + 1
''Text1.Text = DTPicker1
''Else
''If a = "Saturday" Then
''DTPicker1 = DTPicker1 + 2
''Text1.Text = DTPicker1
''End If
''End If
'
'
'DTPicker1 = b
End Sub
Private Sub Form_Load()
DTPicker1.Value = Now()
End Sub
|
|
|
|
|
There are plenty of javascript calendar controls. No-one is going to rewrite this for you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
Does anybody know how to use ado recordset to add new record and save it in VB.NET? I have unboung textboxes and I need be able to add new record and save it to Caller records table?
thanks,
programmer
|
|
|
|
|
Do you mean saving from VB6 to VB.NET?
Cleako
|
|
|
|
|
Hi,
No. I have VB.NET (visual studio 2005) form and I would like to add, and save new records after clicking on a button? Table is called caller records and located on sql server express edition.
thanks,
programmer
|
|
|
|
|
Why are you using ADO ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I have three drop down lists in page1. DDL2 is values are dependant on DDL1, DDL3 values are dependant on DDL2. Once I select DDL values I have submit button that takes the values from these DDL values and redirects to appropriate page based on case statements. Now the issue is the new loaded page is opening with DDL values default to their first value rather than retaining the vales from prevous page values. Can someone help on retaining the values of the DDL between response.redirects.
Appreciate all the help
Raj D
|
|
|
|
|
You should store the value in a session variable and then set it back to the DDL in the page load event.
Cleako
|
|
|
|
|
Trying to sort so that the text box only accepts caps from A-Z and not lower case and if so displays message box,
THANK YOU BEFORE HAND.
|
|
|
|
|
Inherit from the text box control and listen in through the WndProc or KeyDown or KeyUp events. If the key entered does not meet specifications then backspace and have the messagebox. You may also look into applying styles to the text box through Windows API, you could possibly search this site. I know you can apply a constant style like ES_Numbers (contant name is not correct, but it is similar to the actual constant) so that the text box can only accept numbers. Look for styles that begin with ES, and it may help.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Do an TextChanged or some other event and inside create a new regular expression with the values as (A-Z) or something like that, whatever is valid, and either return true if it matches or false if it doesnt.
Cleako
|
|
|
|
|
Why annoy the user if it's a lowercase letter, just convert it to uppercase for them. The following code will only allow letters and it converts them to uppercase. It also allows backspace, delete etc. If you want to message the user for invalid keys you could add a message here as well. Also as suggested before you may want to create your own control and inherit the textbox class, which will allow you to create a reusable control that has this validation built in. You could also simply add handlers so this routine handles all the textboxes you want validated. One other note, users will still be able paste invalid text into the textbox. You should validate this text in the validate event, or prevent users for pasting by setting the property 'ShortcutsEnabled' to false.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
'If key press isn't control key (backspace...and others?) or a letter then ignore it
If Not (Char.IsControl(e.KeyChar) OrElse Char.IsLetter(e.KeyChar)) Then e.Handled = True
'Force capitalized letter
If Char.IsLetter(e.KeyChar) Then e.KeyChar = Char.ToUpper(e.KeyChar)
End Sub
|
|
|
|
|
Cheers mate i can see form this code that it will be very useful but cant get it working at moment the following code e.KeyChar = Char.ToUpper(e.KeyChar) keeps saying that it is read only is this code correct, thank you very much
|
|
|
|
|
The code is correct. I copied and pasted it from my editor. Everything worked fine when I tested it. In the keypress event e.KeyChar shouldn't be readonly. Please post the code you are using. If you didn't make any changes then it should work but post it anyway just so I can verify it. Also what version of Visual Studio are you using?
|
|
|
|
|
Hi using vb.net 2003 and the code is as follows got it working but with the properties but this code will be handy in future.Just curious to why it is not working.This is the only way it does not display read only on the last line so i use it but comment the last line out.
Private Sub txtRow_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtRow.KeyPress<br />
'If key press isn't control key (backspace...and others?) or a letter then ignore it <br />
If Not (Char.IsControl(e.KeyChar) OrElse Char.IsLetter(e.KeyChar)) Then e.Handled = True<br />
'Force capitalized letter <br />
'If Char.IsLetter(e.KeyChar) Then e.KeyChar = Char.ToUpper(e.KeyChar)<br />
End Sub
|
|
|
|
|
I'm also curious. I've never used 2003 so I have no idea what's up with e.keychar being readonly. There has to be a way to change the key pressed. Your code is exactly the same as what I've used. Does 'e' hold any other properties for you. I have two properties 'handled' and 'keychar'. The other possibilty is that in 2003 you need to change the key pressed in the keyup event. Maybe they changed the readonly thing for 2005. However for me all the properties in the keyup event are readonly except for 'handled' and 'suppresskeypress'. 'Handled' doesn't actually seem to do anything 
|
|
|
|
|
thank you got it working by setting the property to upper char casing and also using the code you sent stops them entering any other data, cheers
|
|
|
|
|
I always forget to check for the simplest solution 
|
|
|
|
|
Sir/madam
Is it posible to pass two queries in sqldaaadapter/oledbdataadapter like
dim d as new oledbdataadapter(query1,query1,connection)
dim d as new sqldataadapter(query1,query1,connection)
Thanks and regards
Pankaj
|
|
|
|
|
You can write two queries in the query text if the database supports it. SQL Server does, Access does not.
e.g.
Dim d As New SqlCommand("SELECT * FROM Table1; SELECT * FROM Table2");
|
|
|
|