|
Replace \" against "" and remove the semicolons.
---
b { font-weight: normal; }
|
|
|
|
|
_jsSingle = _jsSingle.Insert(11, "setTimeout(""")
_jsSingle &= """, 300)"
(+= will work also, but it's best to use the dedicated unambiguous concatenation operator in VB).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
|
ahum.. could you help me with this one also ? thanx!
protected override void Render(HtmlTextWriter writer)
{
foreach (GridViewRow r in GridView1.Rows)
{
if (r.RowType == DataControlRowType.DataRow)
{
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00");
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl01");
}
}
base.Render(writer);
}
|
|
|
|
|
I've come up with this but the me.render isn't right... hints anyone ?
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
For Each r As GridViewRow In AgendaView.Rows
If r.RowType = DataControlRowType.DataRow Then
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl00")
Page.ClientScript.RegisterForEventValidation(r.UniqueID + "$ctl01")
End If
Next r
Me.Render(writer)
End Sub
|
|
|
|
|
Use:
MyBase.Render(writer)
Also, it's better to use the "&" concatenation operator in VB since there is no ambiguity ("+" can have undesired results if Option Strict is not set).
(feel free to download the Instant VB demo to convert these types of examples).
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: VB to Python converter
|
|
|
|
|
thank you again! i will try your app! hope i do not come across too many examples in C# instead of vb...
|
|
|
|
|
Hello,
I've drawn a datagrid on my form, and called it grdDataGrid.
I'm looping through a text file to collect relevant column data - putting each portion of my line into variables for Product ID, Transaction Code, Quantity, and Value.
I can't use the split command because the source text file isn't formatted too well, so I'm having to use SubString to collect the required data.
How do I put Product ID, Trans Code, Qty and Value into their own columns in the data grid?
|
|
|
|
|
Hi All!
I've been trying to draw a spectral trace to a picturebox in visual studio Visual basic 2005, but for some reason i cant find out how?!
I need to plot a graph of 500 dots to screen so I assumed the easiest is to draw this in a picturebox. Is this true?
The curve function seems to be the right way to go even though it would be easier to simply draw lines between the dots since as far as i can see this will greatly reduce the ammount of code needed.
I tried the next code:
e.Graphics.DrawCurve(greenPen, curvePoints)
Where curvepoints is populated by an array of points as explained in the msdn description. Do i need to be more specific to draw to a picturebox?
Does anybody know why i dont see anything in my form?
Any tips are very welcome (as i am getting frustrated after not getting a single line on screen )
Cheers
Bas
-- modified at 15:47 Sunday 12th November, 2006
|
|
|
|
|
Why do so many people try to draw onto picture boxes ? You draw onto an Image or Bitmap, THEN you can worry about displaying it ( use a picturebox if you must ).
It's easier to handle your paint event and draw onto that directly.
|
|
|
|
|
Hi Christian,
Thanks for your reply.. it did put thins in another perspective.
Since i am a newbie in the .Net environment, graphics is completely new to me. Could someone explain me in a few words how I can draw a line onto a graphical image and then put it in a Picturebox on the screen?
Thanks a lot for helping!!
Cheers
BaZ
|
|
|
|
|
Bitmap bm = new Bitmap (200, 200); // I think you need to set a pixel depth as well )
using (Graphics gr = Graphics.FromBitmap(bm))
{
gr.DrawLine(20, 20, Pens.White); // Something like that
}
You don't need a picturebox, but you can pass the bitmap to a picturebox here if you like
I'd prefer to make the bitmap a member, or to draw directly onto the graphics object in the paint event.
|
|
|
|
|
I have two option boxes, "optEnabled" and "optDisabled". I need to read a REG_BINARY Value from the key "HKEY_CURRENT_USER\Software\MyApp\DSBkgnd". If the value is "00000000" I need to set optEnabled to Checked an if the value is "01000000" set optDisabled to Checked. I have followed examples on msdn but they wouldn't work.
If anyone can provide the code or suggestions i would be very grateful
|
|
|
|
|
Puggsley wrote: I have followed examples on msdn but they wouldn't work.
Then you didn't follow them properly. Try posting your code. That would also tell us if you're using VB6 or VB.NET.
|
|
|
|
|
Dim readValue As String
readValue = My.Computer.Registry.GetValue_(HKEY_CURRENT_USER\Software\Microsoft\MessengerService", "DSBkgndMode", 0)
If readValue = "00000000" Then
OptEnabled.Checked = True
OptDisabled.Checked = False
Else
OptEnabled.Checked = False
OptDisabled.Checked = True
End If
I have tried using a message box to display the value of readValue but it was always blank
|
|
|
|
|
Well, this won't compile.
readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\MessengerService", "DSBkgndMode", "0")
You probably then want to convert the value to a number, and compare that.
Why have an enabled checkbox and a disabled one ? Isn't that redundant ?
|
|
|
|
|
Also - have you checked if that key exists at all ? DSBkgndMode doesn't exist on my machine.
|
|
|
|
|
I checked that they key exists, and it does. The program compiles with out any errors or warnings, and i have checked again to make sure.
|
|
|
|
|
It can't, the code you posted is missing a quote.
Did you try the code I posted ?
|
|
|
|
|
Soz, it's missing a quaote because i access the internet on a different pc. Where is the code you posted?
|
|
|
|
|
Soz, Its missing a quote cos i'm on the internet on a different pc. Where is the code you posted?
|
|
|
|
|
Please don't double post. Here is my response ( which is visible above, but anyhow.... )
readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\MessengerService", "DSBkgndMode", "0")
You probably then want to convert the value to a number, and compare that.
Why have an enabled checkbox and a disabled one ? Isn't that redundant ?
|
|
|
|
|
I've had to restart the pc, and now im getting build errors in "Private Sub InitializeComponent()" There is 12 differnet errors, all for code generated by the form designer. Im gonna redo this form from scratch then get back tomorrow.
Thanks for the help
|
|
|
|
|
Hi everyone,
I've been working on this for 2 weeks and am at my wits end.
I have to read in 20 random numbers between 10 and 100, inclusive, and then display them with no duplicate numbers. The random array is no problem, but I can't seem to be able to loose the duplicate numbers. I started with the array unsorted, had not luck, so I sorted it first, but still no luck. Here's some snippets to show the direction I've been trying. (I hope I'm posting this right)
<Private Sub cmdSort_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cmdSort.Click
Dim array1 As Integer() = New Integer() {randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101), randomObject.Next(10, 101), randomObject.Next(10, 101), _
randomObject.Next(10, 101)}
Dim i, j As Integer
txtOutput.Text = ""
' omitted code for bubblesort
BubbleSort(array1)
For i = 0 To array1.GetUpperBound(0)
BinarySearch(array1, array1(i))
If array1(i) > 0 Then
txtOutput.Text &= array1(i) & " "
End If
Next
End Sub
Function BinarySearch(ByVal array As Integer(), _
ByVal key As Integer) As Integer
Dim low As Integer = 0 ' low index
Dim high As Integer = array.GetUpperBound(0) ' high index
Dim middle As Integer ' middle index
Dim number As Integer
key = number
While low <= high
middle = (low + high) \ 2
If key = array(middle) Then ' match
Return -1
ElseIf key < array(middle) Then ' search low end
high = middle - 1 ' of array
Else
low = middle + 1
End If
End While
Return number ' search key not found
End Function>
maddogjbm
-- modified at 14:39 Sunday 12th November, 2006
|
|
|
|
|
Hm... your code raises more questions than it answers...
Why do you call the BinarySearch function without taking care of the return value?
As the random numbers are always between 10 and 100, when do you expect the if statement that checks if it is larger than zero to exclude any value?
Why do you write your own BinarySearch, when there already exists one in the framework?
Why do you have the parameter key in the BinarySearch method, when you don't use it?
Why don't assign any value to the variable number?
---
b { font-weight: normal; }
|
|
|
|
|