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.
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
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
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]
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..
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:
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.
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.
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.
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?
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
My HScrollbar will only go to 9 less than the specified Maximum value. I want it to go from 0 to255. When I set the Maximum value to 255 and run the program the slider indicates 246 when full right. I can get it to go to 255 by setting the Maximum value to 264 but this seems very wrong.
the title pretty much sums up the problem: the existing HScrollBar control does not expose a MouseUp event. How do I go about adding this event to the control? I'm using VS2005.
I have created a program that forms in a panel will be shown (control add). But how can I run-time form an over all other forms when I bring the number of the control panel in the know?
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]
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.
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?
I'm trying to bring a transparent user control (being used as a drawing layer) to the front, over a page that will be playing video.Me.BringToFront() didn't seem to work, and when I tried Me.SetTopLevel(true) in the load, this gave me an InvalidOperationException. Here's what I have so far, sorry for the commented lines.. lots of trial and error (I'm very new, just an intern at the moment)[code]
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.
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?
Do the VScrollBar and HScrollBar controls have a known Value bug?I'm using VB10. While testing some code I used a Horizontal Scroll Bar to change a value on the fly, I thought my code had some bad math in it until I discovered that when the bar is scrolled to the very far right the Value was not equal to its Maximum value setting like it is in VB6, the same happens for the Vertical scroll bar control, set the maximum to 100 the Value will only go up to 91, set max to 200 and value only goes to 191, etc.
I have an InkPicture larger than can fit on screen and so am using Panel with AutoScroll. When I scroll down and start inking the picture it is fine. But if the InkPicture loses focus and I attempt to ink the picture again, the InkPicture position will change, it resets to original position. I have been stuck on this for some time now.
Using VS 2010 Pro SP1 - XP Pro SP3 I set a breakpoint with F9 and the line turns Red. When I press F5 to start debugging, the Red Breakpoint jumps to another line a few lines away.
I have a weird behavior with tabs on a VB.NET form.On a form I have several comboboxes, text boxes, and 2 buttons.I have made sure my tabindex are in the order I desire, meaning combobox1 has tabindex 1, combobox2 tabindex 2, button1 tabindex5,etc..Here is the behavior, when I first open the form, if I tab from combobox1 it jumps directly to the button, instead of combobox2, however once I help things with the mouse, it will tab in the appropriate order.