Determine And Alter The Control With The Greater Value?
Jun 2, 2010
I have two columns of numbers that hold team scores for different events. I am looking for a OO way to Color the textbox of the team with the highest score in each event. I know the following will not do it (without writing a complex set of If Then Statements) but I think it might paint a clearer picture of what I am trying to do.
VB
Private Sub ColorWinner(ByVal crtl01 As Control, ByVal crtl02 As Control)
If CDec(crtl01.Text) > CDec(crtl02.Text) Then
crtl01.BackColor = Color.Gold
[Code].....
The controls are always going to be text boxes. So basicaly I want to determine the text box with the highest value and act on it without having to write a complex series of nested IF Statements.
View 2 Replies
ADVERTISEMENT
Feb 10, 2012
with more control over changing values in a data bound DataGridView.On form load, all the data is pulled down from the attached database and fills the gridIf I want to change one of the values in the grid, I can put my mouse cursor in the cell, change the entry and save it back to the database.
View 10 Replies
Nov 5, 2011
Public Shared Function IsType(ctrl As Control, ByVal thisType As ??????) As Boolean Return (TypeOf ctrl Is thisType) I need a function that I can call, for example, to determine if a control is type RichTextbox.dim z as Boolean= IsType(txtBox1, RichTextBox) I ned to determine if a control is a given type (i.e., not always RichTextBox). I don't know what Type to make thisType. Can this be done?Actually I simpified the problem but if the above is answered I can write the function
View 4 Replies
Dec 12, 2009
I need to determine the type of a WinForms control in a collection.
[Code]...
View 1 Replies
Apr 11, 2011
I have a program with 32 PictureBoxes (pb1 ... pb32). The user will select one of the picture boxes. All picture boxes will call the same subroutine, passing the variable of the name of the box clicked. Rather than writing a click event for all 32 boxes, and call the same subroutine from each event, is there a way that I can determine which picture box has been clicked?
View 3 Replies
Jun 6, 2011
Is there a way to determine is any control at all on a form has gotten focus? I know you can individually determine if a single control has focus or has been clicked, etc. but is there an event that can tell you that some/any control has been clicked?
i.e.
Private Sub myFrm_Magic(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.SomethingClicked
Msgbox(Me.ActiveControl.Name)
End Sub
View 1 Replies
Jul 12, 2011
I've written a piece of code that takes 3 fields from a database and writes out the 3 added together, but with the middle field cropped down, so that the total number of characters is always 28, what I thought was the width of my listbox. I realised when I debugged though, that the listbox was docked and grew or shrank depending on the size of the screen.
Is there a way to determine how many fixed width characters will fit in a control, at run time?
View 1 Replies
Mar 3, 2010
I have three buttons on my main form, say Form1. Clicking any of the buttons brings up Form2 modally for input, it's a number pad. Now, depending on which button was clicked to get there, after the user enters his numbers, I need to change a specific label on Form1. In other words, btn1 clicked puts user input into lbl1 and so on... I could probably do this with a variable but wondering if there is a more elegant way.
View 3 Replies
Feb 19, 2009
I have a project setup, where depending on a certain variable one of two controls will be used. Either the default webbrowser or the gecko control. Now I can load either one fine dynamically but I can't work out how to use either one depending on a variable result.To load the one I know I want is easy enough..
Code:
Private WithEvents wb As Skybound.Gecko.GeckoWebBrowser
wb = New Skybound.Gecko.GeckoWebBrowser()
Me.Controls.Add(wb)
[code]....
I want my webbrowser to be called wb as I already have all the event handlers written.
View 7 Replies
Dec 8, 2011
i have an if statement that neds to check if the control passed is a checkbox or a radio button
If TypeOf (Control) Is CheckBox Then
If count = 1 Then
text += Me.GetCheckBoxValueJQuerySyntax(Control.ClientID) & " + '~' + "[code]......
This fails as the checkbox and redio button derive from the same class, so how woudld i check if the control is a checkbox or a radio button.
View 2 Replies
Jan 25, 2012
I'm writing a control that needs to check a property of the form it's placed in.Is there a way to do that?
View 1 Replies
Jun 17, 2010
Does anyone know how to capture and save the font style of a label control.
(FontStyle.Bold, FontStyle.Italic, FontStyle.Underline)
I need to be able to save the font style and have it reapplied when I reopon my form. I know how to "reapply" it when I open the form again. I just need help getting the original value for saving purposes.
View 6 Replies
Oct 9, 2009
I have a small piece of code that iterates through the controls collection on a panel (below) Everything works fine until I want to focus on a control that doesn't support the selectall method i.e. a datetimepicker. Is there any way of determining the type of control and not call the selectall method when the type is datetimepicker. All my other controls support it so that's the only one I need to exclude.
[code]...
View 2 Replies
Mar 2, 2010
In reading various answers regarding "masked TextBox Control, am I to assume that the masked textBox control uses a mask to determine what characters the user can enter into the control?
View 1 Replies
Nov 14, 2010
I've created the following basic function to determine whether specific control type is currently loaded:
Private Function IsPreviewerTypeLoaded(Of T)() As Boolean
For Each previewer In LoadedPreviewers
If previewer.GetType().Equals(T) Then
[Code]....
I need to compare each control against the generic type supplied. Equals(T) fails to do the job, producing a compiler error. How to make it correctly?
UPDATE: is the following correct?
previewer.GetType().Equals(GetType(T))
View 2 Replies
Apr 14, 2009
I have three buttons that all share the same context menu. How can I determine which control called the context menu to appear?
View 4 Replies
Mar 7, 2011
To avoid the TRY Catch Block, is there a way to determine if the control supports the specified event without having a try catch block?
[code]...
View 1 Replies
Nov 28, 2011
I've found various C# examples here, but I can't seem to get a VB version working.I want to be able to pass a simple variable into a User Control to determine whether it shows a certain section of data.It's basically a Customer Data form, and in some circumstances I need to show a line with the customers account number and sort code, and in some I don't, so my user control:
<controls:customerForm ID='customerForm' showBankDetails="no" runat='server' />
But I can't work out what to do with the showBankDetails variable in Code Behind to stop it from rendering that section, or simply hide it with a CSS snippet.How do I access that variable in the code behind using VB.NET?
View 1 Replies
Mar 27, 2012
I have a program that has two list boxes. I want to have the user right click either listbox and remove an item using the context menu option. I have tried to use GetChildAtPoint (control.mouseposition) but I cannot return a control the mouse is over. I then tried to use the _Click event of the context menu to get the sender, but the sender is the contextmenu control. Here is the code I am using:
Dim ctrl As Control = Me.GetChildAtPoint(Control.MousePosition)
If ctrl Is Nothing Then
Exit Sub
[Code]....
View 2 Replies
Mar 15, 2010
I have numberic updown control in my app. There may be times when I want to programatically change the vlaue (in which case I don't want to ValueChanged event handler code to run). There will certainly be times when the user makes a change (in which case, I would want the event handler code to run).
[Code]...
View 5 Replies
Aug 22, 2010
I am modifying some code I found here to test to see if a user has scrolled to the end of the control. In this case the control is a Crystal Viewer but I posted here because I think the issue is based on the vertical scrollbar not the Crystal Viewer itself.
The code flags an error at
Me.CRViewer.Controls.OfType
Indicating 'OfType' is not a member of 'System.Windows.Forms.Control.ControlCollection'.
I understand the concept that I can't reference something that it is not but I don't know how to fix it. The original code was for a DataGridView.
The ultimate goal (not finished) is to find out when the user has used the mouse or possibly the scroll bar itself and if it hits the bottom of the page of the viewer, then trigger a new page so it looks like they can just keep using the mouse to scroll.
Public Sub New()
Me.InitializeComponent()
Dim vscroll As VScrollBar = Me.CRViewer.Controls.OfType(Of VScrollBar)
[Code]...
View 9 Replies
Sep 17, 2011
how to manipulate the dates to determine which date will be 30 days more then the datetime control I have on my form. i need to take the chosen date from the DateTime control, and determine what date it will be in 30 days. Eventually I will use this process to search through the database to print monthly reports.
View 4 Replies
Jan 15, 2012
I have a label called 'Label1' on a form called 'Deck1Form' and I have another form called 'PlaylistForm' on this form I have a listbox with some data. I want to change 'Label1' on form 'Deck1Form' to the value that is currently selected[code]....
View 12 Replies
Dec 8, 2009
Is there a way to alter a specific row to a column?
Like i want to alter a row but not the whole thing only one column?
View 2 Replies
May 6, 2009
Is it possible to alter or add to the VB code through a form?
I have a combobox that has a list of over 3000 vendors. The edit list that comes with combobox will only hold a little over 1700 lines, so I used the combobox1.items.add to the (form1 events - load) code. Now I have access to all 3000 + vendor names in the ComboBox1. But if I design an add vendor form, how would I code it, so the vendor would be added to the bottom of the items.add list in the code?
View 1 Replies
Jul 13, 2010
I don't know what I did now, but I managed to somehow have form1's properties show background color as black, but it is a light silver color and no matter what color I assign it, it will not change. right now form1 is empty of textboxes, labels, etc. There is code in it for my menu and the other forms.
View 2 Replies
Mar 30, 2010
Has found the project (program) which to me it is very necessary. But has faced стем that I can not alter it Under myself as not I wrote this project and in vb.net at initial level of knowledge.I ask your help, simply any more I do not know where will access.It is a little about the program: it is monitoring of a game server.In the program it is made the following: three items of review of the information on a server. Which operations can be called, at first to press on +, and then to press in a text appearance etc. options.Here a program picture: gsw1.jpg I would like to make in shape easier! Simply to create three leaves of review of the information Here an example picture that it would be desirable to make: gsw_my.jpg
View 1 Replies
Jul 8, 2008
Is there a way alter the window of a 3rd party application? Resize, Minimizie, Make Transparent..
View 14 Replies
Feb 12, 2011
I'm making this little exe where you fill in a few textboxes, choose a few items from a picklist, push a button and a new outlook-message appears with, depending on what you've chosen and filled in, different mail recipients, subject and body.I was wondering how I could alter the font from the body of the e-mail. I've been searching the internet for a while now and I think it's really specific.I was thinking of putting the text in a string (or something like that), alter the font of the string and then put the string as body of the e-mail, but even that is confusing.[code]
View 2 Replies
Mar 1, 2010
I have developed small visual basic.windows forms application with VS2010 RC. I have a development SQL Server named RJHDEVELOP. I've added a data connection to this server and everything runs well. When I come to deploy it onto the factory server named CARRONSBS, how do I tell the deployment package I want to the dataconnection to be a different server name?
View 1 Replies