|
OK, you have it in reverse. You're not actually going to select all four textboxes, because you are doing what I already told you is wrong - four random numbers instead of 0,1,2,3 sorted randomly.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
hello sir
yes i got it and i have done it as you said this is my stupid mistake sir
and this is the code and it's works fine all along i was thinking that i am randomizing wrong answers but i wasn't i was randomizing textbox which is not possible but any way this the way i learn
thanks again
Dim X, Y As Integer, Placed(3) As Boolean<br />
For X = 0 To 3<br />
Do<br />
Y = CInt(Int(Rnd() * 4)) ' Randomize 4 wrong answers<br />
Loop Until Placed(Y) = False 'Loop until it's not same number<br />
Placed(Y) = True<br />
MyTB(X).Text = WAnswer(Y) ' Place randomly selected wrong answer in text box <br />
Next<br />
<br />
'now randomize one correct answer<br />
MyTB(CInt(Rnd() * 3)).Text = PoAns
thank you very much sir
have a nice day
|
|
|
|
|
I'm doing this form that has a glossary. I created the alphabitical letters using link labels, and the glossary using labels. How can write the code so that when a click on one of the letters(link labels) i go to the grossponding letter( label )
Regards,
Senior MeMe ..
|
|
|
|
|
Handle the click event and call the focus method on the label you want to focus on.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
i stil can't solve my problem in database i have use sql to store my date
INSERT INTO `LOGIN/OUT` (`Time_login`, `Time_logout`)
VALUES (?, ?, ?, ?)
but i stil can't save anything..the method i use was drag and drop
when writing code i use tableadapter to save ir it it's gave me error
LOGIN_OUTBindingSource.EndEdit()<br />
LOGIN_OUTTableAdapter.InsertQueryEmp(Me.Definition_dbDataSet )
can anyone here help me solve it..actually how to insert time into database.data type i use date/time.
|
|
|
|
|
SQL statements are weird in .NET. You have to request insert commands from the adapter and it becomes a hassle. Here is a working example of what you need to do to create a new row in SQL:
<br />
Dim strTopic As String = InputBox("Enter a topic")<br />
Dim sql As String = "SELECT ID, CourseID, Topic FROM tblTopics WHERE ID = 0"<br />
Dim da As New OleDbDataAdapter(sql, cn)<br />
Dim ds As New DataSet<br />
da.Fill(ds)<br />
Dim cmdbuilder As New OleDbCommandBuilder(da)<br />
da.InsertCommand = cmdbuilder.GetInsertCommand<br />
Dim dr As DataRow = ds.Tables(0).NewRow<br />
dr("CourseID") = Me.lngCourseID(Me.cboCourse.SelectedIndex)<br />
dr("Topic") = strTopic<br />
ds.Tables(0).Rows.Add(dr)<br />
da.Update(ds)<br />
cn.Close()<br />
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[ ^]
|
|
|
|
|
hai friends
i m a vb.net programmer,
i have no idea of vb 6.0
my previous project is in vb 6.0 and for it i m doing a small module..
i have a doubt regarding it..
i want to write code for combo selected index change ....
i in runtime , iwill add few items to it ... when i select an item then some task has to be performed..
i written like this ...
Private Sub Combo7_Change()
// do some task here
End Sub
but it is not working ...
wt to do
plz help me..
thanks in advance
vijay
devulapally_vijay@yahoo.co.in
|
|
|
|
|
You need a bit more code in there...
Private Sub Combo7_Change(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Combo7.SelectedIndexChanged
End Sub
That should work
If you are using visual studio, this code should can be put in automatically if you use the properties box.
|
|
|
|
|
that code diplay all current program installed on my computer,
i need to control this programs ,when i select program from listbox1 and click button service stop(and anthor button to start)?anyone help me plseae code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim key As Microsoft.Win32.RegistryKey
Dim mainkey As Microsoft.Win32.RegistryKey
Dim iLp As Integer
mainkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
Dim sKeys() As String = mainkey.GetSubKeyNames
For iLp = 0 To sKeys.Length - 1
key = mainkey.OpenSubKey(sKeys(iLp), False)
ListBox1.Items.Add(key.GetValue("DisplayName") & " - " & key.GetValue("Version"))
Next iLp
End Sub
Ahmed hassan
modified on Sunday, April 6, 2008 4:55 PM
|
|
|
|
|
Oh, I get it now. Edit your post to add someting to it, don't post anohter.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Hi
How do I find a value in a excelsheet ex. "Sum=123" and pass it to a textbox with the row number? I don't know how to come further with this.
On Error Resume Next<br />
TextBox1.Text = xlWorkSheet.Range("A1:A10").Find( _<br />
What:="Sum=123", MatchCase:=False, _<br />
SearchOrder:=xlApp.ByColumns).Offset(0, 1).Value<br />
If Err.Number Then TextBox1.Text = "No Match Found"
modified on Sunday, April 6, 2008 4:43 AM
|
|
|
|
|
I have developed a program with too many date fields. I have used datetimepicker for this with formating dd/MM/yyyy.
This will create problem if any user have system date format in m/d/yyyy
So I want that when my program start it will detect system date format and if format is in m/d/yyyy then it converts into mm/DD/yyyy and at the time of closing my program it converts into it's original format.
If any one have any code in support of this problem, please send me immediatly.
Thanks
Pathak
|
|
|
|
|
hiiiiiiii..,,
why are u trying to change the system date format,
change your datetimepicker format to system format.
use below code
Format(DateTimePicker4.Value, "yyMMdd")
thanks
Bye..
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
If any user have date format in dd/MM/yyyy then I save 08/04/2008, it saved same and displayed in same format.
but if he changed his format in m/d/yyyy and i give 08/04/2008 then when we retrive date it shows lik 04/08/2008.
And if use format here then it creates problem with dd/MM/yyyy format.
|
|
|
|
|
The format is just change the display. The .Value is still a DateTime type.
Unless you use ToString() and not the DateTime value, then you got to look at how you save and retrieve the value.
|
|
|
|
|
As darklev pointed out, your base error is if you are storing your dates as a string. If you are using a database then you MUST use the date data type to store your data. If you persist in using a string to store the date your will never be free of the formating problem.
|
|
|
|
|
i have couple of csv files, some are comma separated, some tab separated, some are unicode and some are ansi.
what is the easiest way to find out what delimiter the file uses and its encoding.
thank you.
|
|
|
|
|
what do you mean by easiest ????
You want to know the delimeter/unicode with out opening the csv file.
??????????
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
no. maybe ill rephrase the question..
how do i do it ??
|
|
|
|
|
Haimbert wrote: what is the easiest way to find out what delimiter the file uses
Asking the user what it is.
Beyond that, you have to analyze the file to determine what the most likely delimeter is. You'd have to ask the user if the delimiter you've figured out is actually correct.
Haimbert wrote: what is the easiest way to find out ... its encoding.
This is generally impossible to determine reliably. But, the StreamReader class can attempt to figure out what the encoding is, but there is no guarantee it's going to be correct. Again, asking the user if what has been determined as most likely correct is the only way to be sure.
|
|
|
|
|
Hi,
1.
open the file and see if you can read it; you might use File.ReadAllLines for this.
most formats (e.g. UTF8) have some byte codes in front to indicate what encoding they are
using (look with a hex editor for 0xFF 0xFE or 0xFE 0xFF), so the system has a good chance
of reading them correctly by default.
2.
if you expect no comma's in fields and you find a comma, then comma is the delimiter.
same for tabs.
if you expect both to be possible, then you need two passes:
in the first pass, count comma's and tabs; the most popular will be the delimiter.
in the second pass, process the data.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's 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.
|
|
|
|
|
Hello,
I am making an application which can control a pabx (telephone switch).
I connect my pc and the pabx via com port.
For the connection setup i have to send some characterlines to the pabx.
Sending normal ascii characters works fine. I use:
SerialPort.WriteLine(Chr(&H10) & Chr(&H2) & Chr(&H20) & Chr(&H2) & Chr(&H0) & Chr(&H10) & Chr(&H3))
However, i have to send also hex97 (for example).
Is there someone who can give me some information.
I guess i have to change the character set? But how?
Regards,
Bas
modified on Saturday, April 5, 2008 6:12 AM
|
|
|
|
|
Send Ascii value insted if Hexcode
example
i want to sent " charachter
SerialPort.WriteLine(Chr(34))
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
Hello Rajesh,
Thanks for your answer.
I tried but when i send the character instead of Hex then i stil have to use an other character set, because hex97 = character 151. Standard ascii set starts at 0 and ends at 127. Extended ascii character set starts at 128 and ends at 255. As i have to send hex97 or character 151 i guess i have to change the character set but i do not know how and to which character set.
Regards,
Bas
|
|
|
|
|
try with ChrW() insted of Chr()
reply me...
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|