Get Active Control Of Form?
Mar 30, 2009I want to get the active control (control which has the focus or where the cursor is on) each time the cursor moves to another control or each time a control receives a focus.
View 1 RepliesI want to get the active control (control which has the focus or where the cursor is on) each time the cursor moves to another control or each time a control receives a focus.
View 1 RepliesI want to get the active control (control which has the focus or where the cursor is on) each time the cursor moves to another control or each time a control receives a focus.
View 5 RepliesI'm an old Access developer and know VBA quite well, but now I'm working at learning VB.net. I'm trying to find the equivilent of the following Access VBA code using VB.net:
Function EvalField()
Dim x As Integer, ctl As Control
Set ctl = Screen.ActiveControl
x = Val(Mid(ctl.Name, 5))
Screen.ActiveForm.Controls("Formula" & x) = ctl
ctl = Eval(ctl)
UpdateTotal
End Function
This code sets a control variable to the currently active control, then copies the text from that control into it's matching "Formula" field for reference by the user), then turns the string of math into the answer. For example, if the user enters 5 + 4, that will be copied to the Formula textbox, then it will be evaluated and the answer will replace the 5 + 4. And lastly, the UpdateTotal sub will execute which will add this answer to the existing Total field.
After getting the current mdi active child form, how can I get it's control collection so I can access their data?
View 8 RepliesIs there any way to skip a the validating event of the active control when the close button of the form is clicked. It is very annoying when user wants to close the form, but due to the validate event of the active control, it asks for the valid input. The user is forced to give valid input to close the form. I have searched a lot for this on net but no any proper solution could be found.
View 5 RepliesI would like to get the control name, regardless of if its on the projects form or not. put it in a thumbnail following the mouse...
So if i open up notepad it would give me the active control name...
I have 9 textboxes in 1 form and couple of buttons to add unicode symbols inside the last active textbox when the button is pressed. So how do I find out which textbox was last active when the button was pressed.
View 10 Replieshow to get the name of the active control in Visual basic
system.reflection..... that doesnt work
like i use addhandler so if I do that it gets me the name of the adress of the original control
Also, I'm trying to get a toolstripdropdown menu as a bookmarks thing; how can I get the name of the selected dropdown item?
It has to be a simple line of code but I do not know how to construct it. Using VB 2010 Express, I have a MDI parent form and many child forms. I want the parent form to determine what child form is active and load data into the RichTextBox1 on the child form. Each Child form has a RichTextBox1. The parent form gets its data by loading a file.
I am close to a solution but just can't get there. You will see in the code below, if I make a direct reference to a specific child form, it works great. What I want to do is to use the Active Form function to determine which form to write to. I have looked at the MS tutorial which gets me close.
Private
Sub OpenToolStripMenuItem_Click(ByVal sender
As System.Object,
[Code].....
The following code lets me insert an image into an Active X Image box using 'GetOpenFilename', however, if I push the Cancel button I get an error saying that the file cannot be found. Can anyone provide me with some advice on how to handle this error, the code is below?
Private Sub Image1_Click()
Dim ImageOneLocation As String
ImageOneLocation = Application.GetOpenFilename
[code]....
In small project I am making , when I load the main for the list box is generated by data from xml ,well that done well , but I cant get the control active and I can getit to select item
Me activecontrol = listbox 1
ListBox1.SelectedItem = 0
I have got a project that i am currently creating that is a basic word processing application. There is the capability to have unlimited MDI child forms open however when you click on change font colour of something similar i only want it to do it in the currently active MDIChild. I have found the Me.activemdichild however i cant then access controls on that form.
View 4 RepliesI created a TabControl with 3 Pages. Like TabPage1, TabPage2 and TabPage3. How to check which page is active in tabcontrol? Using visual basic 2010.
View 4 RepliesI have a tab control with two tabs. Both tabs have controls which are unique to them, but there is one control which I would like to always appear on whichever tab is currently active. I figure I just need to add some code to TabControl1_SelectedIndexChanged(). I tried
MyControl.Parent = TabControl1.TabPages(
TabControl1.TabPages.IndexOf(TabControl1.SelectedTab))
MyControl.Parent.Update() ' is this necessary?
[code]....
I have developed an active x control and signed it with certificate. I know that digital signing is needed , so that the browser knows that the active x comes valid source.My asp.net form has a button , which invokes a method on activex control as -[code]....
But it errors on browser stating that the - IE has blocked this site from using an active x control in an unsafe manner. ( Please see attachment).So should I have to develop the active x control which implement IObjectSafety and also signed digitally, so that it can execute on client browser without any warnings from IE. Any examples.
I'm using VB.NET within Visual Studio 2008.I have a ActiveX control on my form that contains a method that takes an Array. In VB6 I just passed in the array and it was populated OK. When I do the same in VB.NET, I get a result but the value of each index appears to be a pointer.Here is the C++ method code...
void CMyCtrl::GetRowInfo(const VARIANT FAR& vArray, short sNumRows)
{
// Declaretemp array to put the row list into
short asRowList[24];
[code]....
Here is the VB code (same VB6 and VB.NET...
Dim maintRowList(0 To 23) As Integer
AxMyCtrl.GetRowInfo(maintRowList, 24)
In VB6, the value of maintRowList(0) is in the range 0 to Windows screen height(its a pixel value)In VB.NET the value of maintRowList(0) is a value that looks like a pointer to me (e.g 285671429).In VB.NET, the type of the 1st parameter is Object. In VB6 it is a Variant. I've tried AxMyCtrl.GetRowInfo(maintRowList(0), 24) and got the same result. I think I need to get a pointer to either the array or the first element of the array but I can't see a way to do that. how I can pass an array to this type of C++ ActiveX method?BTW - I cannot change the ActiveX code so the solution must be within VB.NET.
I am trying to have any only one form type eg Countries, Projects, or Vendors etc. open at the same time. So, if a user has the Country form open and goes to open it again from the menu I would like the applaication to bring the form to the Front of the MDI container. I have tried a number of things like BringToFront, ActivateMdiChild, etc.
[Code]....
i am making my final year project in vb.net for data entry i want to make the project more user friendly i use code to change the control focus by pressing 'Enter'(ASCII 13).. and clear the content of current control by pressing 'Esc'(ASCII 27)... in my project one form contains at-least 300 of controls say(t1,t2,t3,t4...)
so in the keypress event of t1 i have writen
if asc(e.keychar)=13 then
t2.focus
elseif asc(e.keychar)=27 then
t1.text=nothing
end if
the code works fine but produce an alert beep when i press ENTER to change the active control...
i want to know is there any way i can zoom my form in vb.net. i could resize the form and byanchoring all controls to left top right bottom i can make it look like zoom. but it is not actually zooming. it is resizing. while font size and other formats are still as same.
View 1 RepliesWhen debugging in VB6 it was easy to find the name of the active form because it was automatically highlighted in the Project Explorer.
How do I find the name of the active form in VS2010?
I need to build a program that can get the form's name of whatever window/application that is currently active/in focus. How do I do that?
View 2 RepliesI would like to put an active login form where by if one fails toput the correct password after 3 trials the program exits
View 1 RepliesI have a mdi application. When some childforms are open (but only one is active) and the user press a button, I want to know, what form is open, because depending on this, an event will fire up. I imagine this so: at first I determine the active form with a separate function. And then with a select case statement the event will be fired up. How can I make this?
View 2 Replieshow to specifically identify all the specific table cells that are selected in a webbrowser control. To be specific once I load a page into the webbrowser control and it is displayed I simply want to be able to click and drag with the mouse over multiple cells. Once I have selected the multiple cells I want to be able to do something to them such as adding an attribute. I can do this with a single cell. With the follwoing code:
Private
Sub
WebBrowser1_DocumentCompleted(ByVal
[Code]......
I am writing an application where active directory validation is required before accessing the main form. There are 2 forms. Form 2 is the login form and form 1 is the main form. The main form would have a simple look, with about 10 checkboxes.I have managed to get the authentication working great but what now need to do is validate groups. Say if "user A" is in "groups A,B and C" and "user B" is in "groups B and C" i would like for them to use my login form, once they log in, the groups that they are members of would appear in a listbox on either form, (whichever is easiest) and is hidden from the user ... if they are in group A, then the main form would show only the first 3 checkboxes, if they are in group B, then it would show the 4th and 5th checkboxes, if in both groups then show the first 5 checkboxes etc.It is a simple idea, but is complicated to explain.As i said, the login form is working with the active directory... here is the code for the login form:[code]Form1 in the code is my main form, and wish for it to change according to which groups the user is in.
View 9 RepliesI am developing a Windows Forms application. I have four forms which is inherited from Baseform in another project. In all four forms I am using a label to show some transaction count based on network status. I have implemented a thread which gets the active form of application and setting up the text. The code works fine if application screen is active. If I minimize and open any other application, I am getting an null error exception.
How do I get the active form of an application?
Private Sub StartThread()
pollThread =New Thread(AddressOf PollfileStatus)
pollThread.IsBackground =True
running =True
pollThread.Start()
[Code] .....
I am new to vb.net and what I want to do is change the bg color if my form is active.
I have tried searches and try and fail but I cant figure it out
I was wondering if there's a method to set the form as the active window (not topmost obviously), if it's currently not the active window (meaning another window is currently the active one). By active I mean "selected".
View 1 RepliesHow can i get the color of the caption of the active form in winforms?
View 1 RepliesI want to get the contents of the active child MDI form, how do you do that? Here's what I did to create a child form.
childForm += 1
If childForm > UBound(childForms) Then
ReDim childForms(childForm)
[Code].....
So say I want to get the text from an active form. How can I get the active form id so I can just do this?
childforms(childform).textbox1.text