|
Mình muốn hiển thị giá trị tương ứng trên combox khi di mouse qua thi se hiển thị được giá trị của nó ! Có ai có cách không giúp mình với ! Cám ơn nhiều
|
|
|
|
|
CodeProject is an English speaking board. You might want to repost your question in English or have someone translate for you.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
OK, mouse is clear, and combox probably stands for combobox , hence the answer is: yes, you can select combobox items with the mouse.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Dear All,
This is related to IList concept in .net 2.0,
I have Ilist property i.e CourseOptions,
There one storedProcedure That return result like this
ID VALue Text
1 Averages YES
2 Honor Rolls NO
4 Marking Period Totals YES
8 Class Ranks NO
16 Transcripts YES
32 PRC YES
64 Attendance NO
128 Print On Schedule NO
256 Print On Matrix NO
512 Offered Course NO
1024 Nat'l. Hon. Soc. NO
2048 No Marks NO
8192 Junior Hon. Soc. NO
I Want to get all the values of Text column.
These columns i need to bound to IList of CourseOptions I can doit
Pls help me in this
Thanks N Advance
|
|
|
|
|
Don't cross post. You have also posted this message in the SQL forum.
|
|
|
|
|
Has anyone implemented aggregation in VB .NET
Please advise with sample code.
|
|
|
|
|
What do you mean ? Do you mean in how data is displayed ?
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 )
|
|
|
|
|
Dear All,
does anybody know how to set the decimal point in smart device ?
I write code like the following lines:
Imports System.Globalization
Imports System.Threading
Public Class frmDecimalTest
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ci As New CultureInfo("it-IT")
Dim nfi As New NumberFormatInfo
nfi.CurrencyDecimalSeparator = ","
nfi.CurrencyGroupSeparator = "."
ci.NumberFormat = nfi
'Thread.CurrentThread.CurrentCulture = ci
End Sub
End Class
I don't know how to set the current culture (in smart device application, there is no Thread.CurrentThread.CurrentCulture event. Thanks a lot for helping
|
|
|
|
|
how to link of two forms in vb
naidu
|
|
|
|
|
Your header is the name of the forum, and your question would have made a good header. What do you mean by 'link' ? Do you mean pass information between them ? You can put properties on a child form and access them from the main form, but delegates are the best way to communicate between forms.
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 )
|
|
|
|
|
here are my sample of codes i write a program that make an addition if checkbox checked or radio button checked i tried to show all of it with "toplam" but it gives the result 0 where i did something false any ideas???
Public Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
forma = TextBox1.Text / 16
End Sub
Dim baskisayi As Single
Public Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
baskisayi = TextBox2.Text / 500
Call isaretliyi_bul()
End Sub
Private Sub isaretliyi_bul()
If RadioButton1.Checked Then
toplam &= Ayarlar.TextBox1.Text * forma
ElseIf RadioButton2.Checked Then
toplam &= Ayarlar.TextBox2.Text * forma
ElseIf RadioButton3.Checked Then
toplam &= Ayarlar.TextBox3.Text * forma
ElseIf RadioButton4.Checked Then
toplam &= Ayarlar.TextBox4.Text * forma
ElseIf RadioButton5.Checked Then
toplam &= Ayarlar.TextBox18.Text * baskisayi
ElseIf RadioButton6.Checked Then
toplam &= Ayarlar.TextBox17.Text * baskisayi
ElseIf RadioButton7.Checked Then
toplam &= Ayarlar.TextBox15.Text * baskisayi
ElseIf RadioButton8.Checked Then
toplam &= Ayarlar.TextBox19.Text * baskisayi
ElseIf RadioButton9.Checked Then
toplam &= Ayarlar.TextBox20.Text * baskisayi
ElseIf RadioButton10.Checked Then
toplam &= Ayarlar.TextBox21.Text * baskisayi
ElseIf RadioButton11.Checked Then
toplam &= Ayarlar.TextBox16.Text * baskisayi
ElseIf CheckBox1.Checked Then
toplam &= Ayarlar.iccizim.Text
ElseIf RadioButton12.Checked Then
toplam &= Ayarlar.rcilt.Text * forma
ElseIf RadioButton13.Checked Then
toplam &= Ayarlar.cilt.Text * forma
ElseIf CheckBox6.Checked Then
toplam &= Ayarlar.ressam.Text
ElseIf CheckBox2.Checked Then
toplam &= Ayarlar.bandrol.Text * baskisayi
ElseIf CheckBox3.Checked Then
toplam &= Ayarlar.ambalaj.Text * baskisayi
ElseIf CheckBox4.Checked Then
toplam &= Ayarlar.nakliye.Text * baskisayi
ElseIf CheckBox8.Checked Then
toplam &= Ayarlar.dizgi.Text * forma
ElseIf CheckBox9.Checked Then
toplam &= Ayarlar.kapak.Text
ElseIf CheckBox5.Checked Then
toplam &= Ayarlar.ozalit.Text
ElseIf CheckBox10.Checked Then
toplam &= Ayarlar.baski.Text
ElseIf CheckBox7.Checked Then
toplam &= Ayarlar.ctp.Text
End If
|
|
|
|
|
I have no idea what you're asking, but this code is incredibly nasty.
Use a switch instead of all these elseifs, assuming there's no other way. And, for goodness sakes, give your checkbox variables meaningful names. If the code for checkbox9 and checkbox8 are the wrong way around here, how would you tell ?
alpdoruk wrote: forma = TextBox1.Text / 16
If TextBox1 ( there are those variables again ) has a value < 16, the return value will be 0. and so, the result will be 0.
alpdoruk wrote: Ayarlar.TextBox1.Text * forma
It looks to me like you have a form with public variables ( textboxes ). Don't do that. Expose the strings only if you need to.
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 )
|
|
|
|
|
ok i am doing know these corrections but is the call funktion correct?
|
|
|
|
|
Like I said, it seems possible that you're multiplying by zero. I also don't see any code that should show the result. I also am not sure if &= is what you want, this does a bitwise AND. At least, it does in C#. What does it do in VB ?
You should set a breakpoint and step through the code, to work out what is wrong.
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 )
|
|
|
|
|
no no it's not multiplying with zero i give a more number then 16 
|
|
|
|
|
&= concatenates strings, doesn't it ? Have you stepped through the debugger to see what it is doing ?
VB totally sucks, your problem could be to do with the implicit conversions that are going on.
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 )
|
|
|
|
|
Briefly looking at the code, and as Christian has eluded to, there are a lot of potential problems that could be eliminated by making the code type safe. To do this include Option Strict as the first line of the code file. You can do this at a project level in the compilation options.
Once you have don this you'll have to cast all those TextBox.Text values to integers, for example:
forma = TextBox1.Text / 16
becomes:
forma = CInt(TextBox1.Text) / 16
Assuming forma is actually an integer.
Once you've done this, if something is wrong you should get a runtime error tring to cast the the text in you textboxes that will point you towards the next step of your debug process.
Hope this helps
Tom
|
|
|
|
|
forma is single and i could't look step by step in VB 2005.i didn't know how to do it and it gives no error
|
|
|
|
|
Put a break point in on the first line of code that you want to step through. To do this put the cursor on the line and press F9.
Then run the code. It will stop at that point, press F11 to step through each line of code and put your cursor over the variables to see what's in their values.
Cheers
Tom
|
|
|
|
|
to convert textbox text to single:
froma = cdec(textbox.text)
Note that if a non-numeric character (a letter or a symbol) is entered into the textbox it will cause an exception error, to get around that use a validation technique such as
if isnumeric(textbox.text) = false then<br />
messagebox.show("you did not enter a number!")<br />
textbox.focus()<br />
end if<br />
what this does is alerts the user to his/her error and forces them to correct it
now as for the step-by-step.
The step-by-step shows you what the complier is actually running, so if it never gets highlighted it never has been called
Example:
if true= true than<br />
'this code will always run<br />
else if x = 10 then<br />
'this code will never run<br />
else<br />
'this code will also never run<br />
end if<br />
Hopes this helps
There are 10 types of people in the world: those who understand binary and those who don't
|
|
|
|
|
Hi, I program a Writing Application now. My Question is: How can I make Object- or Tableproperty's?
|
|
|
|
|
You're going to have to explain this a bit more. Make a what?
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I mean changing borders or cell background
|
|
|
|
|
TimHot wrote: DHTML Editing
There's a dinosaur from the past. All the documentation on it has been archived it's so old.
Let's see the code you're using to add the table.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Here is the code:
Dim doc As Object = Form1.txt.DOM<br />
Dim selection As Object = doc.selection<br />
Dim tr As Object = selection.createrange<br />
Dim c, r As Integer<br />
Dim HtmlCode As New System.Text.StringBuilder<br />
Dim anp As String = ""<br />
Dim sty As String = ""<br />
Select Case anpass<br />
Case Style.fest<br />
anp = breite<br />
Case Style.inahlt<br />
anp = ""<br />
Case Style.Window<br />
anp = "100%"<br />
sty = "table-layout:fixed;" & Chr(34)<br />
End Select<br />
HtmlCode.Append("<table style=" & Chr(34) & sty & " border=""thin"" cellspacing = " & cellspan & " rowspacing = " & rowspan & " width= " & anp & " bordercolor=" & bcolor & ">")<br />
For r = 1 To CInt(rows)<br />
HtmlCode.Append("<tr>")<br />
For c = 1 To CInt(cols)<br />
HtmlCode.Append("<td>")<br />
HtmlCode.Append("</td>")<br />
Next<br />
HtmlCode.Append("</tr>")<br />
Next<br />
HtmlCode.Append("</table>")<br />
tr.pasteHTML(HtmlCode.ToString)
|
|
|
|