|
Ooops - you are right. *blush*
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
sir,
I try this, txtqty as one text box in its text change property i have checked
if not is numeric (txtqty.text) then
Msg box ( "Please Enter only numeric values")
txtqty.setfocus
End if
After that while Checking the values in Qty Box through a button click with below code, it was not working, Am not a programming professional, because of my own interest am trying to develop some small projects. dont mistaken me,thanks For your help
|
|
|
|
|
K so you did the check
so now instead of
txtqty.text>"2"
use
integer.parse(txtqty.text) > 2
Your code is comparing a string you can't use that for the > < operators
|
|
|
|
|
I have a crystal report, report viewer and a database. the Crystal Report gets its data when datagridview1 item is selected(changed). But I couldn't find the problem why variable "disv3" can't get value at run time. "DS" is my crystal report dataset which acts as datasource.
Dim rpt As New GradeReport
Dim dd As New DS
rpt.SetDataSource(dd)
Dim paramfield1, param2, param3 As New ParameterField
Dim paramfields As New ParameterFields
Dim discreteval1, disv2, disv3 As ParameterDiscreteValue
paramfield1.Name = "column1"
param2.Name = "column2"
param3.Name = "column3"
TextBox5.Text = "introduction to management"
' For i As Integer = 0 To DataGridView1.Rows.Count - 1
discreteval1 = New ParameterDiscreteValue
discreteval1.Value = DataGridView1.CurrentCell.Value.ToString
paramfield1.CurrentValues.Add(discreteval1)
disv2 = New ParameterDiscreteValue
disv2.Value = DataGridView1.CurrentRow.Cells(1).Value.ToString
param2.CurrentValues.Add(disv2)
disv3 = New ParameterDiscreteValue
' TextBox5.DataBindings.Add(New Binding("text", bs, "coursename"))
c.custView = New DataView(c.ds.Tables("student"), "", "studid", DataViewRowState.CurrentRows)
For c.rowIndex = 0 To c.ds.Tables("student").Rows.Count - 1
disv3.Value = c.custView(c.rowIndex)("StudentFullName").ToString
param3.CurrentValues.Add(disv3)
Next
paramfields.Add(paramfield1)
paramfields.Add(param2)
paramfields.Add(param3)
GradeReportForm.CrystalReportViewer1.ParameterFieldInfo = paramfields
GradeReportForm.CrystalReportViewer1.AutoSize = True
'Next
GradeReportForm.CrystalReportViewer1.ReportSource = rpt
GradeReportForm.Show()
GradeReportForm.CrystalReportViewer1.Refresh()
modified on Tuesday, August 18, 2009 5:09 AM
|
|
|
|
|
I Want Use a chart in Form In Vb.net
and my chart read a value from table in database
and i want to chart represent value by percent
help me....
|
|
|
|
|
If you bought a charting package, read the docs or ask them for help
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi friends,
i want to download winpadlock activex control for vb as free.
where i get that?.
i already try in the following website but it not works properly.
www.winPadlock.co.nr
www.winPadlock.uni.cc
[^]
other websites are give that freely by they ask to join member with some payment.
i want free download of that, where i get that?
plz help.
thanks
Vasanth.A
|
|
|
|
|
If it's not free, then you need to pay for it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It's amazing what you can find when you type "winpadlock" into Google.
|
|
|
|
|
I try to fix the small problems that my calculator has
For example, if I type 78/3=26 (all this from keyboard)
This is what I want the program to work.. If I type 78 from keyboard with "/" (divide) and 3.. when I hit "ENTER" from keyboard. I should get 26...
my current calculator doesn't accept "/" (divide) and ENTER to give result
if found this code online, can someone try to fix or tell me how to make the code below work for my problem
code:
Private Sub txt_KeyPress(ByVal KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) And KeyAscii <> 13 _
And KeyAscii <> 45 And KeyAscii <> 8 Then
KeyAscii = 109
End If
End Sub
My second problem on my calculator:
I want to check if the number enter to textbox is the at end of textbox, then
it give me a beep sound...and do not accept any more numeratic number (1-9)...and the beep sound when the user try to press any number 1-9.
my current code doesn't work...please help me and see my code below. how to fix the code below that will work for me?
If TxtDisplay.MaxLength = "27" Then '27 means the only max number 'can enter in textbox
TxtDisplay.Enabled
End If
I appreciated all the great help you can provide!!!!
This code is done in VB 2008
|
|
|
|
|
You are utterly lost.
1 - you have code to only accept numbers. The code is crap, but it will work. You need to add code to accept the /, etc, as well as writing code to parse what is entered. Your best bet is to store numbers as you detect a modifier, then work on them from there.
2 - Again, you are lost. You can set the max length property, but it's not going to be a string, surely ? Either way, setting the max length is all you need to do, unless your code from question 1 actually stops accepting numbers after a certain length.
Overall, it looks like you're grabbing code off the web and guessing. If you're doing a class, read your book. If you're teaching yourself, buy a book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am new to VB and try to learn new language. Please be patient with me. you can read all the books, but you don't get real hand on practice in programming in VB. practice in VB is the way to go.(learn programming). i learn to programming in VB with doing it not watching the code.
I saw the code online..and try to modify that work to my need...i stuck and found the sample online.....to fix for my need...
can someone give me the sample code that will work to the problem that i describe on the original forum?
-Andy
Thanks
|
|
|
|
|
vblearner09 wrote: . you can read all the books, but you don't get real hand on practice in programming in VB.
No. But, by trying to write code when you have no idea, you learn nothing, either. You should read a book and do the exercises in the book, so you learn by applying things you know, not by copying and pasting code off the web, and asking us to fix it because you have no idea what it does.
vblearner09 wrote: can someone give me the sample code that will work to the problem that i describe on the original forum?
I'm sorry, I thought you said you wanted to learn ? You don't want to read a book, what would make me think you would read the code, rather than copy and paste it ?
There is no substitute for knowledge. Knowledge is different to guessing. Please buy a book and work through it,
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
What good book you recommend to buy in VB that has a lot of example? Since you seem to know about programming in VB, what book would you recommend?
my calculator program works on most the part...
-Andy
|
|
|
|
|
I don't know, it's been so long since I learned ( and I learned C# ). I would look at Amazon for a book that has a lot of good reviews. I'd tend towards a 'teach yourself in 24 hours' type book, so you start with the basics.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can someone explain what e.Handled = True
does?
-Andy
|
|
|
|
|
If you bought a book, it would explain it. If you googled it, that would work to.
Some event handlers pass an event args with a 'handled' property. If you set it to true, the event is marked as handled and no further processes occur.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I have a loop at the moment that creates a number loop that is 5 deep, each number in a sequence can only be used once...for example
12345
12354
12435
54321 etc...
Here is what i have for the code creating this sequencing...
SortOrder = New List(Of Integer())
Dim iTemp(PanelDepth) As Integer, iCount As Integer = 0
For a As Integer = 0 To PanelDepth - 1
For b As Integer = 0 To PanelDepth - 1
If b <> a Then
For c As Integer = 0 To PanelDepth - 1
If c <> b And c <> a Then
For d As Integer = 0 To PanelDepth - 1
If d <> c And d <> b And d <> a Then
For e As Integer = 0 To PanelDepth - 1
If e <> d And e <> c And e <> b And e <> a Then
ReDim iTemp(PanelDepth)
iTemp(0) = a
iTemp(1) = b
iTemp(2) = c
iTemp(3) = d
iTemp(4) = e
SortOrder.Add(iTemp)
End If
Next
End If
Next
End If
Next
End If
Next
Next
my dilemma is that i need it to be variable on the depth of the sequencing, so for example i might need it to calculate 9 deep, so 123456789, or even more 10/11 sometimes, but i am having trouble coming up with a way to do this, anyone got some ideas that i could try to get it to loop through and still create individual number sets for a n deep sequence?
ta.
|
|
|
|
|
I would start with a list of numbers, from 1 -> x, then I'd write code to pull numbers from that sequence to create a number using every possible combination.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i understand the theory, but trying to get my head around the coding of that theory is what i am after assistance with :P
|
|
|
|
|
Just solved it, i used a subroutine, and called that sub inside itself for each depth and it then looped inside that and called itself again and again...works a treat
|
|
|
|
|
Yes, recursion is the right technique here. If you do it right, you get all the results in a predictable order (e.g. numeric ascending if your original data was numeric ascending).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
There are some interesting approaches to generating permutations that you may want to check out. Google will be your friend.
In your case, a lexicographic ordered permutation algorithm may be the right one. You can find an example here[^].
There are many permutation generation algorithms on Knuth's The Art Of Computer Programming and other similar books, if you want to dig more into it.
However, you should be aware that the time complexity for generating permutations is of order O(n!), whatever algorithm you use, so you may bump on the time barrier if you raise your "n" too much. It's still an improvement over the naive nested for loops algorithm you tried as first solution, which has time complexity O(n^n).
Enjoy!
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Good evening everybody,
in a viewer application I display images read from a non-GDI-compatible format through an RGB array:
Dim arrayImage() As Byte = MakeRGBArray(Me.DPXFile, ImageOffset, Width)
Dim gch As GCHandle = GCHandle.Alloc(arrayImage, GCHandleType.Pinned)
Dim pBuf As IntPtr = gch.AddrOfPinnedObject
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
PictureBox1.Image = New Bitmap(Width, Height, 3 * Width, Imaging.PixelFormat.Format24bppRgb, pBuf)
gch.Free()
This basically works, but from time to time I run into trouble (i.e. the program crashes) when resizing or refreshing the form or the picture box. The AccessViolationException reports an attempt to read from protected memory, so I figure the GCHandle might not be freed before unloading the picture
I'm not experienced regarding the memory details, but it seems to work to leave the last line away and free the handle just before the next picture is loaded with If gch.IsAllocated Then gch.Free() . Could anybody please tell me if I'm on the right track with that or running into the next trouble? More questions arise from that, like: Would the handle be freed automatically when the form is closed?
Thanks for advice
Mick
|
|
|
|