Enabling And Disabling A Control?

Apr 12, 2011

I am enrolled in a class in Visual Basic 2008. I wanted to drop the class, but it is too late. Now, I am stuck with this project that the professor assigned and it's due this Thursday. Anyway, how do I do this: The credit card number TextBox control is dynamically enabled/disabled depending on the choice of payment type? And did I do the newOrderButton correctly (see code below)? This is also the clear button. And is there a way to do a reset Form? Sorry for that many questions. I am really lost right now because there is a lot to do in this project and I don't even have a clue of how I am going to finish this project.

Private Sub newOrderButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles newOrderButton.Click
' clears all the information that is displayed and start over

[code]......

View 6 Replies


ADVERTISEMENT

Hscrollbar Freezes And Control Jumps To Front After Clic And Enabling/disabling?

Jan 14, 2010

I have successfully ported a VB6 application to VB.NET (VS2008, .NET 2.0). Much optimization and rewriting has been done, but there is one possible BUG i cannot overcome. I have a standard HSCROLLBAR control used for accepting a numeric input. The control needs to be disabled during complex computational routines to prevent additional user input. I am setting the enabled property to false and reenabling the control at the end of the calculation cycle. The control is enabled and disabled a few times, because some code has been placed in the onpaint event of a drawing area, and separating the calculation part from the drawing part will be a huge task.

Large changes are handled correctly. Small changes aren't. The problem is that the control freezes in a unknown state after clicking on the arrows. A second click makes the control (and its parent control box) jump up and over everything else in their container.The scrollbar remains functional only via the contextual menu. This happens both in debug and release builds. There are no overrides. Coding/Test platform XP SP3 (more than 1 machine).

There is no code whatsoever that handles neither the parent control nor the scrollbar repositioning and resizing. The only code takes the value of the scrollbar and passes to the calculation section. If I omit disabling and reenabling the control, everything works fine.i tried rebuilding the control from scratch. forcing enabling the control after it has gone haywire does not make changes, disabling the groupbox instead of the single control doesn't make any difference, debugging step by step confirms that things go wrong when drawing the controls within the private system form classes.

View 3 Replies

Disabling/Enabling USB Ports?

Jun 6, 2011

I am creating a USB "cookie dispenser" (long story) and I plan on programming it by, when cookie.exe starts, it disables the port, you plug the USB in and press a button and it enables the port (thus powering the device). What I need to know is, is this at all possible? And if so, can you help me get it to work? I know I should put in an effort but it's late for me (UK) and I want to post this overnight so that you guys (in the USA may

View 8 Replies

Enabling And Disabling Buttons

Sep 18, 2011

I have a program and I need the Submit time button to be disabled after I enter 5 numbers and then the Get Payment button needs to be enabled. I have been playing around for several hours but cannot figure out how to do it.[code]

View 4 Replies

More Window Enabling / Disabling Troubles

Oct 31, 2010

when I got home to try out the method in the above post in my real application things did not work out.The big difference is that my main form is a MDI. When I open my edit form, it's mdiparent is set to the main form. When I click 'edit' and then disable "me" the entire application goes modal.I was expecting only the MDI child to go disabled, not the whole application..Basically, I want only the MDI child window that opens it's "edit" dialog to go disabled..

View 1 Replies

VS 2005 Enabling And Disabling The Combobox

Aug 14, 2009

Here lies my form: Attachment 72542 I have to perform save and show operations with the access database. If i select the Bank Account radiobutton(Radiobutton1) then Bank Account No. combobox is enabled,Credit Card No. combobox is disabled and user can input the value only in the Bank Account No. field. When the form loads then both the combobox1 and combobox2 are disabled and as the user selects the radiobutton the combobox are enabled accordingly. So i did the following code in the form load event:

[Code]...

View 15 Replies

VS 2008 Enabling / Disabling The Controls?

Apr 28, 2009

i have this function to enable disable the controls on a form....

Private Sub EnableDisableAll(ByVal xType As Boolean)
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
ctl.Enabled = xType

[Code]...

everything fine ...but when the controls r disabled it shows in the dull color. can i change the color ? as u can see i have given the command to change the forcolor to red to textbox but it still shows in dull greay... i dont want it to be enabled as i am using this to just give a view of records....the back color is changing to white but not the forecolor.....is there any thing more to be done...or any better way so as the items remain enabled but i dont allow the changes to be done.

View 11 Replies

VS 2008 Enabling And Disabling Buttons?

Sep 11, 2009

MessageBox.Show("Disabled")
Button1.Enabled = False
Button2.Enabled = True

[code].....

View 5 Replies

VS 2008 Enabling/Disabling A Textbox?

Jan 31, 2010

I'm trying to make a program where when textbox1 doesn't have a value, textbox2 is disabled but when a value is entered to textbox1, textbox2 will be enabled.

View 13 Replies

VS 2008 Propertygrid Enabling / Disabling

Jan 13, 2011

how can i selectively disable propertygrid items, or even categories based on the value of another property? i read somewhere about a typedescriptor but i couldn't find a good example.

View 6 Replies

Enabling/Disabling Controls Inside A Repeater Isn't Working?

Jul 10, 2011

I'm trying to enable/disable controls inside a repeater:

<asp:Repeater ID="Repeater1" OnItemCommand="RepeaterItemCommand" runat="server">
<HeaderTemplate>
<table>
<th>

[code]....

View 2 Replies

Containers - Why All Contained Controls Within A Groupbox Do NOT Respond To Enabling / Disabling

Feb 10, 2011

I'm working on a winform which contains several controls like textboxes, radio buttons, datagridviews... All of these controls have been added to a main group box called gbDataEntry. My problem is when the user is seeing the form, I set gbDataEntry.Enabled = False but I want to enable some controls like DataGridviews so the user can scroll them. After disabling gbDataGridview I set DataGridView1.Enabled = True but it seems that the datagridview does not respond to this line. Why?

View 1 Replies

Enabling/Disabling A ToolStripMenuItem Programmatically Does Not Enable/Disable The Object

Jul 15, 2009

I am developing an application with a DataGridView (dgvData) that requires a ToolStipMenuItem (tsmiSelectNetwork) of a ContextMenuStrip (cmsNetwork) to be enabled and disabled programmatically based on if the column is sorted or not.

I have set:

'tsmiSelectNetwork.Enabled = False' at runtime
'tsmiSelectNetwork.Text = Select All' at runtime
'dgvData.Columns(5).ContextMenuStrip = cmsNetwork' programmatically

When dgvData is sorted by column 5, tsmiSelectNetwork.Enabled should be set to True; when it is sorted by any other column, it should be set to False (see code below)

Private Sub dgvData_Sorted(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgvData.Sorted
If Not dgvData.SortedColumn Is Nothing Then

[Code]....

The debug output indicates it is functioning properly, but what you seen on the screen is not.

I am using Visual Studios 2008, version 9.0.30729.1 SP; and .NET Framework 3.5 SP1; ContextMenuStrip version 2.0.0.0

View 6 Replies

Enabling Flash In The VB Web Browser Control?

Jun 5, 2009

Enabling Flash in the visual basic web browser control?

View 12 Replies

VS 2005 Disabling A Webbrowser Control?

Jun 19, 2009

I want to disable the on screen web browser control I have until the user clicks on a button. I tried using the designmode but then when I reference it it says it is equal to nothing. It seems to clear it down. Here is my code to show my data from the database to the browser control.[code]

View 6 Replies

.net - Can Disabling A Control Cause A Radio Buttons Value To Change

Sep 22, 2010

I have a For Each loop going through the controls in a panel disabling them. When the loop reaches one certain grid control and disables it the CheckedChanged event fires for the next control in the loop which is a radio button.

The call stack is as follows:

System.Windows.Forms.dll!System.Windows.Forms.RadioButton.OnCheckedChanged(System.EventArgs e = {System.EventArgs}) + 0x15 bytes
System.Windows.Forms.dll!System.Windows.Forms.RadioButton.WnProc(Microsoft.AGL.Forms.WM wm = WM_RADIOBUTTON_NOTIFYVALUECHANGED, int wParam = 0, int lParam = 0) + 0x17 bytes

[Code]....

I don't understand how control.Enabled = False can cause the OnCheckedChanged event.

View 2 Replies

Disabling An Html Img Control In A Code Behind File?

Oct 29, 2010

How do i hide an html img from a code behind file in VB.NET? The img tag doesnt have a runat attribute and hence not a server control. I tried

Dim cs As ClientScriptManager = Page.ClientScript
cs.RegisterStartupScript(Me.GetType(), "alert", "alert('test')")

in the Page_Load(). But doest work. I want to access the id using javascript (document.getElementbyId('idofimg').style.visibility = 'hidden')

View 2 Replies

Disabling Dates Before Current Date Of A Datetimepicker Control?

Jun 12, 2009

Is it possible to disable the dates that appear before todays date in a dateTimePicker control?I want to put in some validation so that my users can only select days in the future...ie a future appointment date?

View 5 Replies

RichTextBox Control "loses" Special Formatting After Enabling WordWrap

Jun 11, 2011

I've been developing a text editing application and my problem is that the RichTextBox control will "lose" all special formatting (like font, color etc.) when enabling WordWrap.

View 3 Replies

Alternate Designer - Freeze The Controls From Interacting With Clicking Or Key Presses Without Disabling The Control Itself?

Dec 30, 2011

A recent project of mine has been to make a designer. I've finished everything, but when I click the controls to show the properties window, the control interacts with the cursor. So my question is: How do I freeze the controls from interacting with clicking or key presses without disabling the control itself?

View 11 Replies

Enabling SSL With TcpClient?

Mar 2, 2009

So how does one turn SSL on in System.Net.Sockets.TcpClient with VB.NET code?

Turning it on in System.Net.Mail.SmtpClient is easy, you set the .EnableSsl property. I cannot find a corresponding property in TcpClient. It's probably buried somewhere.

View 1 Replies

UAC Enabling An Application?

Nov 17, 2009

We have an application that is installed and runs just fine on Vista. Our users are requiring a change to our application in order to change the system time on their PC. The code to change the time is as follows:

Private Sub UpdatePCDate()
Dim _ServerTime As Date = GetServerDate()
Dim _offset As Integer = TimeZone.CurrentTimeZone.GetUtcOffset(_ServerTime).Hours

[Code].....

When this code executes, it bombs because of UAC. How can we modify our program to display the message similar to when they try to change the system time via the Control Panel. That is, it warns them that something is about to happen that requires their permission.

View 2 Replies

Delay The Enabling Of An 'OK' Button?

Nov 4, 2009

I am wanting to know how "You" the reader would "Delay the enabling of the 'OK' button for a user.

View 4 Replies

Enabling A Button From A Text-box?

Jun 6, 2011

I have made a program on Visual Basic 2008. I have put textbox1 and button1 ONLY.I have disabled button1. I want button1 only to be enabled when we type some numbers in textbox1. I also want that we can ONLY type numbers in textbox1, not letters or other symbols.

View 5 Replies

Enabling A Button With An Action?

Jun 30, 2010

I am building an application that has a few elements to it but one of the first elements is that when a user selects a date, they have to hit a button in a message box that confirms the date that they selected and then it enables another button. The code is written as such:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles startDateButton.Click
Dim buttondialogresult As String
Dim confirmbox As DialogResult

[code]....

But when I select ok from the Windows.Forms.DialogResult.Ok, it is not enablind the exceptionsButton.

View 5 Replies

Enabling Button On Another Form

Nov 4, 2010

I have 4 forms. I have a button on form2 that when pressed, I want it to enable a button on form1. What I've tried is this:
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form1.Button3.Enabled
End Sub
But its telling me that the property access must assign to the property or use it's value.

View 5 Replies

Enabling Buttons After They Are Disabled?

May 13, 2012

I attached a picture of how my project should look and what the labels are. There are a total of 12 books and 4 different age groups. In each age group there are 3 books. There is also a previous and next books button which will show the next book in that age group. I want to make it so that previous button is disabled when it is on the first book of each age group and so that the next book button is disabled when it is at the last book. The only issue that I am having is that after the button is disabled it is not enabled again after. Here is my full code for this part as of now. As you can see I made it so that everytime I click on a new age group the previous button is disabled initially.

I took some unnecessary code out of here because I don't want anyone from my class finding this and coping all of my work.

Public Class BookInfoForm
' use this array to display information in this form
Private books(,) As BookInfo = getBooks()

[Code].....

View 3 Replies

Forms :: Enabling A Button On Another Form?

Nov 4, 2010

I have a button on form2 that when pressed, I want it to enable a button on form1.What I've tried is this:

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Form1.Button3.Enabled
End Sub

but its telling me that the property access must assign to the property or use it's value.

View 2 Replies

IDE :: Enabling ActiveX Controls In Webbrowser?

Jun 3, 2006

I am creating a dedicated browser to be used exclusively on a single program located on my hard drive. Security is not a concern as the webbrowser URL will be set to the program's default web page path with no navigation options for going online. The program utilizes dynamic web pages with powerful search capabilities that require ActiveX controls. When I run my browser application, I get a series of security warning boxes stating:

Internet Explorer

An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?

Yes No

Clicking "Yes" allows me to continue and the program features work, but the recurrent warning message boxes are annoying. The default "script errors suppressed" property of the webbrowser control is "false." If I change it to "true" I don't get the security warning boxes but some of the search features on the web pages with ActiveX controls don't work properly.

Is there a way to programmatically enable ActiveX controls in the webbrowser control so that I can set the "script errors suppressed" property to "true" (hence no security warning message boxes) and still allow the ActiveX features to work properly? Or, set the "script errors suppressed" property to "false" and have my program automatically activate the "Yes" button each time a security warning message box is called by Internet Explorer? The goal is to get the ActiveX controls to work in webbrowser without having to click through the warnings.

View 4 Replies

Shortkeys Enabling In An Windows Application Using .NET?

Oct 19, 2009

is there a setting in the options somewhere that makes the shortcut keys show with the underline when you run the application? In the designer it shows the shortcut keys with the underline but when i run the application it does not show the underline indicating a shortcut key. Now if I push the alt key they show up and they work fine just wondering if there is a setting somewhere that will make them show the underline automatically when you run the application so an inexperienced user knows that there are shortcut keys available?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved