Change The Value In Another Function From Another Event?
Apr 1, 2011let say i have a function like this
' create filter
Dim colorFilter As New ColorFiltering()
' configure the filter
[code]....
let say i have a function like this
' create filter
Dim colorFilter As New ColorFiltering()
' configure the filter
[code]....
I develop a website and I have this problem:The registered users on the website should put a (date & time) field, and when the current date will be the same of this date a function (that I developed) should be called.
View 4 RepliesI have 10 textboxes. I write keydown event on each but i want some key down event in a function in a same class.
View 2 RepliesI have a vb.net application which does some processing. This processing can take a while. The application doesn't respond until the processing has ended and then it handle all events (such as click on buttons) that the user has done during the processing. I'd like to add a "Stop" button so that the user can stop the processing at some point. How can I do that? Could threading the processing (which is done in a function of the application) be a possible solution?
I tried to add a button which change a boolean value and putting the code of the processing function inside a while statement based on that boolean value. However it doesn't work because the click event on the button is processed only after the end of the processing.
I have a list of buttons in VB2010.What is the best way to assign a function to their click event.So every button has the same function, e.g.:
On Button Click
FireFunction(1)
End On Button Click
Without having to add a click event for every button.The goal is to produce something similar to what is done with the Control Array idea in Visual Basic 2006.
I have a system that has a gridview on one page with an Update Panel. On selection of one row of a gridview the system posts-back using that CommandName and CommandArgument to post the row that is selected, and then set a Session variable as the ID of that posted selected row. The other controls run Async correctly and the button in question is already registered using this on the RowDataBound event.
Dim gvRowSelect As GridViewRow = e.Row
Dim imbSelect As ImageButton = DirectCast(gvRowSelect.FindControl("imbSelect"), ImageButton)
ScriptManager.GetCurrent(Page).RegisterPostBackControl(imbSelect)
I would like to try and get this session on the button command and somehow within the master page, set a label to the current Session. On the imbSelect command the code is:
Dim cellSnapshot As TableCell = gvSnapshots.Rows(e.CommandArgument).Cells(0)
Session("Snapshot") = cellSnapshot.Text
Within the masterpage is there anyway of calling a function after the Page_Load, and after it has resolved all Postback events?
If I change a subroutine to a function, do I need to change codes that call the subroutine? For example, I have subroutine : Public Sub fillDropDownList(ByRef ddlPage as DropDownList). I need to do unit testing on it, so I changed it to a function: Public Function fillDropDownList(ByRef ddlPage as dropDownList) As DropDownList. Some of my webpages called this sub like this:
Dim cCommon As New
cAdminCommon
cCommon.FillPageDropDown(ddlPage)
ddlPage.SelectedValue = 100
Do I need make change on the call?
This is my code on button event click function
Dim con As New Koneksi
DataGridView1.Rows.Add(con.getIdTambahBarang(cbBarang.Text), _
con.getNamaTambahBarang(cbBarang.Text), _
con.getHargaTambahBarang(cbBarang.Text), _
txtJumlah.Text)
This is my class Koneksi code :
Public Function getIdNamaHargaTambahBarang(ByVal namaBarang As String, ByVal params As String) As String
[Code]...
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.
[Code]...
I think I have a timing issue. On the trigger of an event I call a function to update a value:
Private Sub t0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles t0.Click
Input.ppProperty = "blank"
UpdateRecord("Hey", Input.ppProperty)
MsgBox(Input.ppProperty)
End Sub
[Code] .....
Notice the difference, the property does not update until the function is completely finished.
Why?
I'm having trouble getting an Applications.DoEvents event to function properly. VB keeps telling me I dont have a valid argument. Can anyone look at this and explain how I would complete the expressiojn for Application.DoEvents.
[Code]...
I've got a textbox with a mousehover event and that event will only happen once and then I have to move my mouse out of the text box before it'll happen again. Is there a way to reset the mousehover event 'trigger' so that it happens as many times as I want?
View 7 RepliesNet_mang_Form.Prg_bar.Visible = True
Net_mang_Form.Prg_bar.Value = 0
Net_mang_Form.prg_Timer.Start()
[Code].....
Here Net_mang_Form is Form1 and this code is written in button click event of Form2.
file_send is the function of dll .
prg_Timer is the timer control .
Prg_bar is Progress bar control.
I've got a program that has a text box with a list of files that are on any removable media. Suppose you launch the program and there's nothing in your CD-ROM drive. Right now, you'd get nothing, and you'd have to insert a disc and click a "refresh" button, which triggers a function that repopulates the list.
Is there any good way to call this function on the event that the user inserts/removes a CD-ROM from any CD-ROM drive? Also, inserting/removing external disks and flash drives? Without having to constantly poll the drives. Floppy disks aren't important to me.
I wanna call this jquery function in ASP.NET on button click event
var doRedirect = function() { location.href='http://www.example.com' };
$("#button1").click(function() {
$("#label1").show();
window.setTimeout("$('#label1').fadeOut('slow', doRedirect)", 10000);
});
i created a function procedure and i need to the action to be carried out when i click a button, but a don't know how to call the function procedure under the click event of the button control.
View 1 RepliesI have created in a function, in, lets say, formA :
Private Sub search_name(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dv.RowFilter = "Real_Name LIKE '%" + Form1.txtRealname.Text + "%'"
If dv.Count = 0 Then
MessageBox.Show("Nothing Found", "Error")
Me.Close()
Else
[Code]...
Public Sub search_name(ByVal sender As System.Object, ByVal e As System.EventArgs)this makes it so that the sub is accessable by all classes, rather than Just it's own.
I created a function that retrieves information on which checkboxes are checked. It returns an array which the information coupled to the checking of those checkboxes. Those checkboxes and the matching textboxes are dynamically created at runtime in that same function. I'm pausing the application to wait for a button to be pressed. I'm trying to find a way to use btnDone.Click event directly because the code always reloops my function once more recreating the controls.
Public Function GetArray(ByVal strDLFolder As String) As Array
If blnDone = False Then
Me.Show()
[CODE]..........
Right now I'm setting a create a boolean switch when btnSubDone is clicked. What I would like is for something along the lines of:
[CODE]...........
Is it possible to use events like this? If not is there a cleaner way for pausing the application to wait for a button click (one that doesn't run the entire function again)?
In Visual Basic 6.0, i used to get PostData and Headers in the BeforeNavigate2 event handler function. But when i upgrade to Visual Studio 2005, i got it upgraded to Navigating event handler and there is no PostData and Headers in the handler function. How to access PostData and Headers value in the Navigating function.
[Code]...
I'm trying to prevent a sub / function from firing multiple times on the same event.My app is for handling inbound phone calls (tapi).The app is supposed to route calls based on the callerid number.
aircode below:
Code:
Private Sub OnNewCall(ByVal sender As Object, ByVal e As NewCallEventArgs) Handles tapiManager.NewCall
if newcall.callerid = "5551001" then
redirect(newcall)
[code]....
If callA.callerid = "5551001" then redirect(callA)but, once it is redirected to the new extension, do not then grab the call from the new extension and try to redirect again (resulting in infinite loop).I realize I could use an integer as a counter, but the problem is, I might actually get more than 1 call at the same time from the same callerid number. And, all the calls would need to be redirected (once).the calls do have properties like (which are unique identifiers to each call):
Code:
phcall.id and phcall.hashcode
I'm thinking I need to put that unique id into a temp var / array to run a check against to see if it has been redirected, if it has then skip, if it has not then redirect.The app would run 24x7, and I don't want the temp var / array to get too big, and would want to have it clean automatically (up on a timer maybe?)(I'm guessing it would be a dynamically growing array.)
I designed a DataGridView under the name "dgvTarifa" and took a chance on trying Row Validating (tried Validated, CellEnter, CellLeave, RowEnter, RowLeave all count same) event. The purpose of the code is to load the selected values of the respective columns into three textboxes in order to rephrase/revalue those and update them by pressing a button. All works fine every single line of code there's nothing wrong except one logical thing.
When the form loads the RowValidating automatically fires because I have a function that Selects the table from the Database and it fills the DataSet by then attaching it to the datasourse of the "dgvTarifa" table. After setting the datasource of the datagridview, it automatically jumps to the RowValidating event which I DONT WANT TO! It first has to finish the whole function and later when the user enters with mouse or enters/leaves a row this has to be fired. (eventually already have the CellClick event with the same code below so only RowValidating has to work properly...)
Here's the code I use at row validating
Code:
Private Sub dgvTarifa_RowValidating(sender As System.Object, e As System.Windows.Forms.DataGridViewCellCancelEventArgs) Handles dgvTarifa.RowValidating
[Code].....
The following code was working the other day. Now it isn't. When I type a character in the textbox the event doesn't fire.
[Code]...
why the event would just stop firing?
I'm trying to make it so this the cursor will jump to the next textbox after the user enters 1 character.
I am having a requirement in my project where User press '.' in his num pad and he wants the character ',' to be displayed (dats bcoz he is French User).
I tried changing the e.KeyCode but it is a readonly property.
Is there any other way to change the key in key events?
I have a dgv with several DataGridViewComboBoxColumns and when the user selects an item from one of these (product dropdown), i need it to repopulate another combobox (color dropdown) in the dgv for that same row - based on the value i get from the product dropdown. I've tried using the EditingControlShowing event; however, it only fires when I first select the dropdown .....?
Is this the right event I should be using? My other issue is that I don't know how to have the color dropdown re-populate for just the column and row I've selected. Here's my code so far for this event:
Private Sub DataGridView1_EditingControlShowing(ByVal sender As Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DataGridView1.EditingControlShowing
Dim myRowIndex As Integer = 0
[code]....
I can't figure out how to make it so that when a variable reaches a certain value, an event is triggered. For example if I wanted a user's level to change to 2 when he gets 1000 exp.
Dim level as integer
Dim exp as integer
*****What do I put here?*****(when exp reaches 1000)
level = 2
I am trying to calculate the 'Profit' field based on the current record's 'ProjectTotalBillingEstimate' field and the 'ProjectActualCost' field. I want the 'Profit' text field to be calculated every time a record is changed, either via the navigation toolbar or the Project ID drop down box. I tried performing the calculation everytime the 'Product ID' changed but then the values in the fields of the previous record were used. I was wondering if there was an event that I could use the would occur only after the entire contents of a record were loaded.Essentially what I need to happen is when one moves to another project record the profit field needs to be calculated only after all the fields update to the current record. [code]
View 6 Repliesin vb.net , event are automatically change for example i write following code for button1 click event
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
ListBox2.Items.Add(TextBox2.Text)
End Sub
next day i open this project. and double click on button4 to write some other statement but there are two click events for button1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)ListBox2.Items.Add(TextBox2.Text) End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
[Code]...
I have been working very hard on figuring this out and just can't understand the events. understand the event process in my code? Or tell me why my image won't switch when it runs the code?
Declarations of Class and members
Partial Public Class Name
Implements IChat
[Code].....
Suppose I have a class that represents a product to be priced using one of a number of different pricing strategies. This pricing occurs hundreds of times per second, so to eliminate repetitive if/else statements I am instead using a delegate to launch the appropriate strategy, like so:
Private Delegate Sub PricingModel(ByVal params As PricingParameters)
Private myPricingModel As PricingModel
Private myPricingParameters As PricingParameters[code].....
But this doesn't look right to me (though it seems to work). Is there an accepted/better way of doing this? Or is this the standard way? Or is this just simply a doomed approach from the start?
Currently just started working with VS2008 I have a SQL script that is returning a number looking time in one of my columns (50625) which is 5:06:25 What I would like some help with is creating a function that would take this value and change it to a real time at some point I will need to do further calculation on these times so I need to be able to add or subtract these results.[code]...
View 3 Replies