|
Hi all,
Hope this is an easy one...
Here is the problem:
In the code-behind, I have dynamically built a series of tablecells each with a Literal control containing an image.
----------------------------------------------------------------------------
dim litCont as New System.Web.UI.WebControls.Literal()
dim strValue as string = "testString"
dim contStr as string = "<img name='pix1' onMouseDown='doMouseDown("& strValue &")' src='images/pix1.jpg' />"
litCont.text = contStr
objCell.Controls.Add(litCont)
----------------------------------------------------------------------------
When the user clicks on any of the images it fires the JavaScript function doMouseDown() which receives a string parameter.
QUESTION: How could I then pass the value of the str parameter to the Label Control ("legend") in "Form1" so that the label may be updated?
I have simplified the structure of the form
----------------------------------------------------------------------------
<html>
<head>
<script language="javaScript">
<!--
function doMouseDown(str){
// code stuff here
}
-->
</script>
</head>
<body >
<form id="form1" runat="server">
<asp:table id="mainTable" runat="server" >
<asp:tableRow runat="server">
<asp:tableCell runat="server">
<asp:label id="legend" runat="server" />
</asp:tableCell>
</asp:tableRow>
</asp:table>
</form>
</body>
</html>
------------------------------------------------------------------------
Thank you
|
|
|
|
|
Your question would be better handled in the ASP.NET Forum[^]. Your question has nothing to do with VB.NET. The solution would be based entirely in JavaScript and the HTML that's generated by the asp tagged controls (Hint, Hint!)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok, I'll seek enlightment in other spheres.
pyb
A true guru not only knows, he can teach too.
|
|
|
|
|
document.GetElementByID("yourlabelname").value = str
hope this helps.
DADA
|
|
|
|
|
Hello Dada,
Thanks for your help.
<i>document.getElementById('legend').innerHTML = str;</i>
The line above is actually what works for me in this particular situation.
Anyway, thanks a lot for taking the time to help.
Cheers,
Pyb
|
|
|
|
|
I implemented a keyboard based tab system in my program. When you are in a control if you press "Enter" then the next control is focused as if you have pressed tab key. What the problem is that when you are in a DateTimePicker or TextControl and press "Enter" a "Dong" sound is heard which is like an error indicatior. How can I get rid of this sound?
|
|
|
|
|
|
Thanks for the link. It solves my problem and it is a comprehensive source solutions.
|
|
|
|
|
Hi
Short time before I had the same problem. This worked for me. The
e.Handled = True
disables the sound.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar = Chr(13) Then
Me.SelectNextControl(Me.TextBox1, True, True, False, True)
End If
e.Handled = True
End Sub
CU
Dave
|
|
|
|
|
In VB 6, one can easily add in the API Viewer and then load up WIn32 API functions and constants in the viewer, so that it can be easily copy and pasted into our applications.In VB.Net, where can I find the APIs and its constants, so that I can cut and paste into my application.
|
|
|
|
|
www.allapi.net try there, there pretty good, examples and everything
"If i was king cigarettes would be free."
|
|
|
|
|
Purple Monk,
That site really helps.
You've given me a green light not purple.
Thanks.
|
|
|
|
|
In VB 6, one can easily add in the API Viewer and then load up WIn32 API functions and constants in the viewer, so that it can be easily copy and pasted into our applications.
In VB.Net, where can I find the APIs and its constants, so that I can cut and paste into my application.
|
|
|
|
|
There is no such app that and database that comes with VB.NET. Your best best for something like this is http://www.pinvoke.net[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Another guy point me to this www.allapi.net
It solved me problem.
|
|
|
|
|
can anyone pls tell me how to watch a video clip in VB.net once a button is clicked...
thx
|
|
|
|
|
With DirectX9. Be careful though, it's one big pathetic joke, read my article on all the bugs in it before using it.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Ok I've created a class that adds buttons, textboxes, checkboxes etc at runtime. I can move all these objects etc. What I would like to do is make the program smart. Basically what I want to is beable to add many buttons, textboxes etc (already working) and link them up ie.
if I click on button1 it writes to a textbox that I specify, which is on the child form
if I click on button2 it opens up a file dialog
if I click on button3 it creates a new Database
if I click on button4 it opens up another form.
also if I want to change these configurations for the buttons I can do so with in the program. Basically you control what you want to do like in vb.net
|
|
|
|
|
I dunno for what reason you want to do so, but here is one way!
first make a string array with dimention of the total commands:
ReDim Action(iButtonsCount)
for each time creating a new button.
then set the array value to some command to be done, e.g.
Action(iButtonsCount)="OpenFileDialog"
then in click button event add:
<br />
Private Sub arrButton_Click(Index as Integer)<br />
Select Case Action(Index)<br />
Case "OpenFileDialog"<br />
'.....<br />
End Select<br />
End Sub<br />
Also if some of your commands need some parameters, you can make the array 2D or more, and set the parameter in the second column in the array.
I hope this will help.
|
|
|
|
|
I am writing a simple VB .Net application that will open a form, establish a socket connection with a server and then display the received data in the forms DataGrid.
Upon startup of the application the form opens. In the Form1.vb form_load procedure I call the ClientSocket class to establish the connection to the server. This is successful. Then I send my login informaiton, again successfully. Then I start receiving data, once again I am successful. I can then pass the received data from a private sub ReceiveCallBacks in the ClientSocket Class to a new Class to parse the data and display it using msgBoxes. But what I really want to do is get the received data back to the form.
Can some one help guide me...If more information about the code is required please let me know and I will post it.
THANKS -
Jennifer
|
|
|
|
|
VB6 says the following expression is too complex
to be computed (provided by a genetic program):
(0.187385 +(0.149214 +oN1*(2.0092+oN1*(5.22783+1.9466*oN1)) +
oReu*(-0.0449582+oReu*(0.00420568+-0.000105206*oReu+0.0137505*oN1) +
oN1*(-0.361811+-0.34512*oN1)))*(-0.647353+(0.149214 +oN1*(2.0092+oN1*(5.22783+1.9466*oN1)) +
oReu*(-0.0449582+oReu*(0.00420568+-0.000105206*oReu+0.0137505*oN1) +
oN1*(-0.361811+-0.34512*oN1)))*(-5.2078)) +(0.0531293 +
oDP3*(0.260794+oDP3*(-0.0914714+0.00960239*oDP3)) +oOPT*(+oOPT*(+0.000904296*oDP3)
+oDP3*(-0.0286061+0.00372593*oDP3)))*(-5.25864+(0.0531293 +oDP3*(0.260794+oDP3*(-0.0914714+0.00960239*oDP3))
+oOPT*(+oOPT*(+0.000904296*oDP3) +
oDP3*(-0.0286061+0.00372593*oDP3)))*(37.8453+-71.5963*(0.0531293 +
oDP3*(0.260794+oDP3*(-0.0914714+0.00960239*oDP3)) +oOPT*(+oOPT*(+0.000904296*oDP3) +
oDP3*(-0.0286061+0.00372593*oDP3)))+-136.292*(0.149214 +oN1*(2.0092+oN1*(5.22783+1.9466*oN1)) +
oReu*(-0.0449582+oReu*(0.00420568+-0.000105206*oReu+0.0137505*oN1) +oN1*(-0.361811+-0.34512*oN1)))) +
(0.149214 +oN1*(2.0092+oN1*(5.22783+1.9466*oN1)) +
oReu*(-0.0449582+oReu*(0.00420568+-0.000105206*oReu+0.0137505*oN1) +
oN1*(-0.361811+-0.34512*oN1)))*(34.1411+55.7764*(0.149214 +oN1*(2.0092+oN1*(5.22783+1.9466*oN1)) +
oReu*(-0.0449582+oReu*(0.00420568+-0.000105206*oReu+0.0137505*oN1) +oN1*(-0.361811+-0.34512*oN1))))))
It contains several common bracketed sub expressions that could be simplified.
Is there any code to simplify this expression and compute it ?
Any suggestions?
aprx
|
|
|
|
|
And you needed VB6 to tell you this?
How are you getting this expression into your VB6 app? Are you cutting and pasting it directly into your code or are you sending the expression to something like VBScript to be evaluated?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi!
I got this expression from a genetic package, then
copied/pasted it in my VB written application.
It usually works but this time the expression is too large.
aprx
|
|
|
|
|
aprx wrote:
then
copied/pasted it in my VB written application.
Ewww... Your going to have to simplify it by hand, before you paste it in.
I suppose you could add expression evaluation support to your app, but that would be a massive undertaking almost as bad as rewriting the genetic package into your VB6 app directly. There are libraries out there that could probably do this, but you'll have to watch out for their capabilities because these libraries will also have limits on how complex the expression can be.
Yahoo search results for "vb6 expression evaluation[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have created my crystal report and binded it to a crystalreportviewer. Once called everything works great. The report shows everything in the database. I am surprised I have gotten this far considering this is my first time using crystal reports with vb.net.
I am trying to only pass one row in and display the one row only. How is this accomplished? I want to pass values of the one row and one row only to the report and display it.
Thanks in advance
Beginner in VB.Net
|
|
|
|