I have a question regarding VB.Net and Object-oriented programming.
I have a solution consisting of two projects.
One project is dedicated to the logic of the application, and one is only to show the Winforms form, and to reflect changes made in the logics project. In other words, when an array filled with various attributes residing in the logics project gets changed, then these changes should be reflected on the form (not that strange in theory).
Here comes the - for me - really tricky part:
I have created user controls, and these are residing in the forms project and placed on the aplication's form. When I click on any one of them, their respective onclick sub gets called okey, but how can I send a message to the logics project from their onclick subs? Basically, I'm not sure on what should be private or not, or possibly how to call the other project correctly. In any case, I can't get it to work.
To sum up: What I need is a line of code calling a class in another project, and someone telling me what should be private, static etc.
I'm having a strange problem with the OnClick event. In an ArcGIS application using VB.Net, I have a button set up with the following
AddItem("CommandAnalyseResults") The following module segment contains the OnClick event: Public NotInheritable Class CommandAnalyseResults Inherits BaseTool <more code...> Public Overrides Sub OnClick()
[Code]...
The OnClick event gets triggered no problem the first time I click on the button. However if I then close the window the button code creates and then click on the button again, the OnClick code is not triggered.
If I click on a different button then click back on the 'problem' button a 2nd time, it does seem to trigger the code!
I have a button that I need to use twice, the first time I click it, it validates that a string inside a textbox is a certain length. That part works. What I want to do is press the same button again but when I press it the second time it is suppose to popup a hidden label. But when I try to use a raiseevent command it gives me an error saying "the button is not an event in my program" tell me how to use the OnClick?
I created a web browser and I want it, whenever I click on my (button) I want to be able to send a message. Here is my code
Dim elmst As System.Windows.Forms.HtmlElement For ii As Integer = 0 To webfriends.Document.All.Count - 1 elmst = webfriends.Document.All.Item(ii) If Not elmst.TagName Is Nothing Then If elmst.TagName.ToLower() = "a" Then [Code] .....
I created a web bowers and i programed it to whenever I click the (button) I want it to click on the "Send Message" and then starts filling out the forms.
I want to define a sub for td of Datalist in VB.Net Here is my Design Code: <asp:DataList ID="subMenu" runat="server"> <ItemTemplate> <table border="0" runat="server" cellpadding="0" cellspacing="0" width="170px"> <tr runat="server"> <td runat="server" id="td_Menu" style="background-image:url(Images/BG.bmp)"onclick="td_Menu_Click"> [Code] .....
I am building a program with the Webbrowser control that goes onto a website, on the website i have a div with a javascript onclick event that I want to 'activate' or be clicked. The when the div is clicked( the class of the div makes the div seem like a picture) a form above the div is submitted. I want to do this with VB code but the problem is thata) im not very experienced in VBb)the div only contains the following code
Now if I click the button it should open the iframe and display the message which I am able to do.Now the problem is how do I call the button1_Click event which is in the codebehind at the same time. I have used OnClick and OnClientClick event as shown below but it's not working and I'm not getting any errors.
I have an Application with 2 forms Form 1 = FrmWindow this is an MdiParent Form Form 2 = FrmInput this is an MdiChild Form
On Form 1 I have a Menu that's says New Input the onclick event looks as follows. Code: Dim ChildForm As Form ChildForm = My.Forms.FrmInput ChildForm.MdiParent = Me ChildForm.Show()
This works and opens the FrmInput as a child of FrmWindow. On the form FrmInput I have two Textbox Controls and 2 Button Controls. Textbox 1 = TxtName Textbox 2 = TxtEmail Button 1 = BtnSave Button 2 = BtnExit
On the On Click event of BtnSave I have Code: SaveInformation() The Public Sub for SaveInformation Looks like this. [Code] .....
So when you click the save button it inserts a new record into the table TblInformation on my SQL database, everything works great. Now my problem is I want to be able to open multiple instances of the form FrmInput at the same time. So I changed the New Input button to the following: Code: Dim ChildForm As Form Dim ChildInstance As New FrmInput ChildForm = ChildInstance ChildForm.MdiParent = Me ChildForm.Show() This works and I can now open up mutiple instances of the form FrmInput, what I cant figure out is how to save the information on a particular instance.
What is the best way to pass a variable from an OnClick event. To elaborate I would like to bind some data to the button and then when that button is pressed I would like to pass that data back to the code behind and do something cool with it.[code]...
I am trying to write an onclick event for textbox but VB.net does not seem to support textbox1.click(). I want to open a new form every time someone clicks on the textbox. Opening a new form is no problem, but I cant detect the click. Is there any event for textbox that detects click event? I saw something like TextboxBase that has Click but I am able to use it well.
This is how my class looks : Partial Public Class TextBoxClick Inherits System.Web.UI.Page End Class
It has some basic load and init events. I am trying to write a Sub like this : Private Sub incident_clicked(ByVal sender As Object, ByVal e As System.EventArgs) Handles Incident.OnClick Incident.Click does not work either. I am guessing I need to import some class to access the Click event but I am not sure which.
I've read thru Iceplug's tutorial on control arrays and got it working. I tried to add a new event by basically copying his click event code and calling it a doubleclick event. I used the proper addhandler and assigned the correct name to my sub. I have the click event changing the background color to blue and the doubleclick event changing the background color to green. The background color does not change to green. Why?
Heres the tutorial with my new code encased in asterisks ...
I am working with a .Net 1.1 web application. There is a Save button that, when clicked, will pop up the Javascript confirm box. Once the user clicks OK a long running process is kicked off. We would like to show a busy indicator when the user clicks the OK button of the confirm dialog.
I have a bunch of divs on my page that are added at run time dynamically. When any of the dynamically added divs are clicked - All need to call the same function in my code behind. Each of the divs must pass it's own ID to the function. I can't use web methods as the function needs to identify which div was clicked and then show/hide/populate other controls on the page.
I've spent quite a while searching this problem, there are some other similar threads online but none have helped me fix it.I have a GridView with an ImageButton within it, the imagebutton has an OnClick function but that event is never reached when it is clicked, below is my gridview:
in my application, I pull in http code from the server side. When this code is placed into the application - the event will happen when clicked in IE, but not in any other browser. Heres the part of the code that deals with the image that is clicked and the event.
LoadChild is a javascript function on the client side of the page. When the image is clicked in anything other than IE , nothing happens. Can anyone see why this is happening? It may be a formatting issue.
I have not been able to get the break point I have on LinkButtonDelete_Click to fire. Is there a trick to dealing with buttons inside of AJAX Accordions?
I have a button on a web page that I just need a little help with some extra code. I think I need a TRY, CATCH statement?, this is what I have so far: I have a simple web page that has a button which at the moment when pressed enables the user to add data to a DB table via a stored procedure.Once this button is pressed a pop up message box is displayed to let the user know the data has been passed. The user then needs to press the 'OK' button within this message box which then directs them to the home page of the site. This works fine.
The code for this is here:
Protected Sub btnAddRawData_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddRawData.Click 'database conn, this is linked to the web config file .AppSettings Using dbconnection As New SqlConnection(ConfigurationManager.AppSettings("dbconnection"))
[code]....
As I don't want the user to enter duplicate records in the database (This could be done by the user navigating back to the page where the btnAddRawData_Click is located and pressing it again.), I have created a UNIQUE INDEX named 'DupRecords' to stop the user from commiting this data more than once that day.When I run the web page now I get the following message in my browser:
Cannot insert duplicate key row in object 'dbo.GasRawData' with unique index 'DupRecords'.The statement has been terminated.The solution I think, is to add a TRY, CATCH statement into the btnAddRawData_Click code.
I'm creating an online exam page with 30 radiobuttons that are created dynamically at runtime. How will I get the click event of each radiobutton and tag it in my method that I will check if the next question is need to be jump or escape. Example: If I'm in question 10 and answer = "Yes", redirect me to Question 15, else go to the next question
I am trying to dynamically create a LinkLabel for my windows form (using vb.net 2005). Here's my It's creating the link; however, I'm having problems creating an onClick event for the new link. When the user clicks, I want it to open the file.
all this in datalist as you can see so it will be repeated..i have put one image in it now i want call a method when any image will be clicked i make one sub called s() in vb i want to call it i use on clientclick() event but doesn't work
I am a new vb user and I have the beta of Visual studio 2010.I have to make a button redirect to another form IN THE SAME FOLDER [code]Now, I assume that if I dont want to mess with the code, I need to click the buttn, go into the properties, events,click.What identifier should go into the click box so that it will automattically open up a file in the same folder?
I have a vb.net windows form app that I am deploying as using the visual studio deployment project. The app needs to write event logs to the application log in the event viewer. For reasons explained here I need to create the event source during the installation process. Something like this to run as part of the installer
If Not EventLog.SourceExists(My.Application.Info.ProductName) Then EventLog.CreateEventSource(My.Application.Info.ProductName, "Application") End If
That code needs to be run during the installer with elevated privileges. So my questions are:
How do I execute that code above as part of the installer? How do I get the installer to do the UAC prompt to allow that code to run as part of the installation?
I have a dropdownlist and a textbox with a button on a form. When a button is clicked it does not go to my onclick even in the code but it goes to my dropdownlist's selectedIndexchanged event. How can I fix this?
just want to ask help in terms of adding new menu item onclick event on an existing menu item. I have a window menu (handles all open window forms in the Parent) once a new window opens i used this [Code] but i need also to add an onlick event on all the forms being added, so when they click that sub menu it will open the form selected. My question is how can i add an onclick event for this newly added menu item?
i want to know how to use vbscript to declare the function that handles the button onclick event or set a function that handles all button onlick event! both will do i.e) ihave a function
"sub xxx() end sub"
and i generate the buttons using vbscript. i can declare the button id, text without problem.
--dim obj as new button() obj.id="aaa" obj.text="ooo"
the above lines work just fine but when i write obj.onclick = "xxx", it doesn't work. by making settings on the function to handle all button onlick event is also acceptible for me!