ASP.NET OnInit() Like Similar Event In WinForms?

Nov 3, 2010

i am using in ASP.NET Application somtimes the OnInit Event. Is there something similar in WinForms?

View 19 Replies


ADVERTISEMENT

Make A Large Grid Of Buttons (24x20 Or Similar) Using Winforms?

May 7, 2012

I'm making a seat booking system in vb.net (WinForms) and I need the user to be able to select the seat they wish to use and for it to change colour (so they can tell that it selected).

I began to try using buttons, but 480 buttons seriously slowed down the load time for the form. I then tried a data grid view with buttons in the rows/columns, but couldnt make that work properly.

Would it be worth trying to use 480 picture boxes and change their background colour? Or would that just slow the form down the same way as 480 buttons?

View 2 Replies

Winforms - Using The Exited Event?

Sep 21, 2010

I'm making a very basic vb.net winforms app, essentially you can drag files into it, and it then uses a batch file to process the files.

It's pretty simple and everything is going to plan so far, it accepts the right files, it uses the batch file to process them and the batch file does what it is supposed to.The only problem is that I don't know how to hook into the Exited event that can/should be raised by the batch file process when the process completes...

I want the DOS window of the batch file to remain hidden while it is running, so I have used ProcessStartInfo to specify the batch file, then set the WindowStyle property of the process to ProcessWindowStyle.Minimised, then used System.Diagnostics.Process.Start(myBatch) to start the process at the appropriate moment.

This is fine, it works and does what I want. However, the only way to tell when a process ends is to use the Exited event. But the Exited event apparently only works with a Process not a ProcessStartInfo. I could switch to use Process instead but then I couldn't (AFAIK) run the DOS window minimised... I've only been writing .net for a few days. This is how I'm running the batch file:

Dim myBatch As New ProcessStartInfo("C:\batchFiles\test.bat")
myBatch.WindowStyle = ProcessWindowStyle.Minimized
system.Diagnostics.Process.Start(myBatch)

View 3 Replies

.net - UserControl Closing Event In Winforms

Mar 4, 2010

I'm trying to save some layouts from DevExpress Grid Controls so that users can change the layouts and reload them in at a later use of the control.

My question is this for speed issues I am loading the control via a user control inside of a form. Now my problem is I am creating the control by adding an instance of the control to a panel control inside of a tabbed group control when the tab is made visible and then clearing the control when the control is hidden.

If ClaimsGridPanelControl.Visible = True Then
ClaimsGridPanelControl.Controls.Add(New RXClaimsGridControl(ClaimsBindingSource))
Else
ClaimsGridPanelControl.Controls.Clear()
End If

So inside of the RxClaimGridControl I need to call a SaveLayout method when I am clearing the control. But there is no event, at least that I can find, that triggers when a usercontrol is removed/closed/hidden.

My thoughts for handling the .Clear() would be to raise an event in the parent control and then to handle that event inside of the user control.

Is there some event that I am missing in regards to the removal/closing/hiding of a user control, or is there a better way to do this.

View 2 Replies

KeyDown Event Not Firing With .NET WinForms?

Oct 22, 2009

I already have KeyPreview set to true in the form properties I'm working on a small program, and I'm having a problem where it seems that some of the controls on it inside groupboxes are not triggering the KeyDown event on my form when I press and release any arrow key, just the KeyUp event. Specifically, I've enabled KeyPreview on the form, and set breakpoints on e.SuppressKeyPress = True in both subroutines, and only the one for frmMain_KeyUp hits the breakpoint.

I added in the two GroupBox events hoping that might mitigate the issue, but no such luck. However, I have a custom control on the form that is specifically coded to ignore these keypresses, and the code works as expected on it.

Private Sub frmMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown, GroupBox1.KeyDown, GroupBox2.KeyDown
e.SuppressKeyPress = True
Select Case e.KeyCode

[code]....

The code in the user control that "ignores" keypresses is as such:

Private Sub TileDropDown_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyValue = 40 OrElse e.KeyValue = 38 OrElse e.KeyValue = 39 OrElse e.KeyValue = 37 Then
e.SuppressKeyPress = True
End If
End Sub

View 1 Replies

Winforms - Remove An Event Handler?

Jun 20, 2012

VB.NET RemoveHandler & Anonymous Methods

If I add an event handler like this:

AddHandler s.Click, AddressOf Panel1_Click

How can I can then remove the event handler?

Private Sub Panel1_click(ByVal sender As Object, ByVal e As System.EventArgs)
' Remove code
End Sub

View 2 Replies

C# - Equivalent Of WinForms TextBox.Validating Event In WPF

Sep 11, 2009

In WinForms I could handle the Validated event to do something after the user changed text in a TextBox. Unlike TextChanged, Validated didn't fire for every character change; it only fired when the user was done.Is there anything in WPF I can use to get the same result, an event raised only after the user is done changing the text?

View 3 Replies

Can't Distribute Winforms Application That Writes To Event Log

Feb 3, 2012

My application writes to the event log if there is an error or other status updates.

The application checks to see if there is an event source named "applicationName"and if not, it creates the source (see code below).

This works fine if the user is an administrator.

If the user is not an administrator, an error is thrown when SourceExists is called:

{"The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security."}

In my environment, the typical user is NOT an admin. Therefore, I cannot use the event log in my application.

Is there a way around this, or is the event log effectively useless for distributed applications?

View 9 Replies

DataBound UserControl And PropertyNameChanged Event In .net Winforms?

Oct 30, 2009

I have a UserControl, with a TextBox and a databound property - Value.Value can be any object such as a Color, Array, Font etc.Any time the text changes, the property Value is changed as long as it is valid.Looking at the msdn article: How to: Apply the PropertyNameChanged Pattern , it says I should use the PropertyNameChanged Event patternfrom the control side.Now, If I have DataSourceUpdateMode = OnValidate, then I don't even need to apply this pattern. If, say. my Value property is bound to a colour field in a business object, then after I type red, in the textbox and tab to another field, then any other fields on the form, that bind to the same colour field, are updated immediately.

View 1 Replies

Winforms - Handle A Form Close Event?

Apr 27, 2011

I have used the below code but its not showing the msgbox. What is wrong with this code ?

Private Sub frmSimple_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
Dim result = MsgBox("Are you sure you want to Exit ?", vbYesNo)
If result = DialogResult.Yes Then
me.Close()
End If
End Sub

View 3 Replies

Winforms Paint Event Handler Fire Every 100 Ms?

May 4, 2011

I have a Windows form UserControl that receives electrical signal waveform data into a 128 element byte array Property every 1,000 ms.

I would like to have the Paint event draw a a subset of the 128 sample points of the array every
100ms (12-13 graphic.drawline operations) to simulate a rolling waveform display such as one would see on an oscilloscope or a medical monitoring device. Is it possible, and if so, how would I set the paint event handler to fire every 100 ms?

View 11 Replies

C# - Why All The Event Checks In The ButtonBase WndProc Method - .Net WinForms

Aug 3, 2010

I'm creating a base class for a button that inherits from Control as opposed to ButtonBase.
I'm using reflector to look at ButtonBase to make sure I don't overlook anything important and I'm puzzled with the contents of the WndProc method. There's checks in there for things like button up, click and capture changed, which as far as I can tell are all handled within the relevent 'On' methods of the class.

View 1 Replies

C# Event Handlers Automatically Created By WinForms Designer?

Jun 18, 2010

Just moved from VB.NET to C#.In VB to connect and Event Handler to a Sub we use the Handles clause.From what it seems, this do not exist in C#. After creating a simple application with a button I realize that Window Forms Designer automatically created an EventHandler to my button1_Click function (after I double clicked it), in Form1.Designer.cs with this code:

this.button1.Click += new System.EventHandler(this.button1_Click);

But, in VB, the WinForms Designer create the Handles clause in my class, in the function header. So, C# create the default EventHandler in designer file, while VB creates in main class where control resides.

View 6 Replies

Developing An Winforms Based Event Tracking System Using .Net?

Sep 24, 2009

I'm looking for some advice for an application I currently developing. I'll try to keep this as brief as possible so if additional info is need just let me know.I'm developing an Winforms based event tracking system using VB.Net (VS 2008 Pro). The application collects data via serial bar code scanners and stores this data within a MS SQL Express db located on the same Windows XP Pro workstation that the application is installed on. When the application receives the formatted string of data it checks the db table and sends a reply back to the device indicating whether the data is a duplicate. I have written a PortManager class to handle the serial based devices and this functionality is working well.

I have now been asked to incorporate a new type of collection device into the system. The new device is running embedded Linux and uses TCPIP (POE) rather than serial communication. The device manufacture has assured me he can provide a string from the devices integrated scanner in the same format as my serial based devices.

If possible, I would like to utilize the current application and just add the ability to use the TCPIP devices to it. I was thinking it might be possible to just add a new class (similar to my Port Manager class) to handle the TCPIP based devices.I'm really at a loss as to the best way to approach this. I'm just not that familiar with collecting data from a Winforms application using a TCPIP based device.

View 3 Replies

WinForms Text Controls - Keypress Event Handler

Mar 14, 2011

In connection with a windows form's text control the keypress event handler provides a key's identity through the KeyChar property of the event argument. This works fine for all alphanumeric keys and Ctl-a ... Ctl-z, Backspace etc. but does nothing for such keys as Insert, Delete, Home, End, and the navigation keys. I would also want to read Ctl and Alt keys combinations etc. I have done these thing before, too many years ago, but forgotten it all. Tried the reference manual, but have not enough years left to succeed that way.

View 1 Replies

.net - WInforms Combobox SelectionChangeCommitted Event Doesn't Always Change SelectedValue

Mar 23, 2012

I have a WinForms app built with VB.Net in VS 2010, and I'm scratching my head over the following issue.I have a form with a combobox which gets bound to a datasource when the form is loaded:

With Me.cboCompany
.DataBindings.Clear()
.DataSource = Me.m_dsBidResults.Tables("Company")
.ValueMember = "company_id"

[code].....

This seems to work fine, as long as the user doesn't switch focus to some other control and then go back to the combobox. After switching focus, if the user then changes the combobox selection to the first item in the dropdown list (SelectedIndex = 0), the SelectionChangeCommitted event fires, but the SelectedValue remains set to the previously selected value. I've verified this by adding a message box in the above event handler, displaying SelectedIndex and SelectedValue side-by-side.

'add this to SelectionChangeCommitted event handler MsgBox(String.Format("Selected Index: {0}, Selected Value: {1}", cboCompany.SelectedIndex, cboCompany.SelectedValue))

This does NOT happen if the user changes SelectedIndex to anything other than 0; everything behaves as expected. I've verified that the table I'm binding to contains unique values for company_id and company_name.Do I need to use some other event to verify that the SelectedValue has actually changed?

View 1 Replies

C# - WinForms: Cannot Get ValidateChildren To Raise Validating Event Of A Child Control?

Jul 8, 2010

In a Windows Form application I have a Form with a UserControl that contains a child control. I have an event handler for the child control's Validating event. On the parent UserControl I call the ValidateChildren() method. But the event handler for the child control's Validating event does not run. The CausesValidation property is set to true on both the parent UserControl and the child control. Is there any reason why the Validating event handler would not run?

The child control is a custom control derived from Panel. It contains two RadioButton controls, both of which have their CausesValidation property set to true.

View 1 Replies

Winforms - Catch The Autosize Double-click Event On A Listview?

May 9, 2011

I am using Visual Studio 2008 and VB.NET. I've got a listview control on my form and I've added columns using the windows forms designer. As you know, if you double-click on the sizer or divider or whatever you want to call it between two columns, the column on the left will autosize (unless you disable that). How can I catch this specific event? The ColumnWidthChanged event and the DoubleClick event are likely candidates, but in the ColumnWidthChanged event, there's no way I can see to determine if it was an autosize. Similarly, there's no simple way to catch what was clicked exactly with the DoubleClick event. how I can catch this specific event type?

View 1 Replies

Winforms - Dynamically Adding Event Handlers To Dynamic Panels?

Mar 31, 2012

so i have a series of panels that are generated

example:

For i as integer 1 to dt.rows.count
dim subpan as new panel
*Code for creating panel"
Next

the problem is i need to be able to add event handlers to each of them including, click, mouseEnter and mouseLeave but i can't figure out how to index each panel so that they can be accessed and identified. i tried using a property but that didn't seem to work or i was doing it wrong.

View 2 Replies

WInforms Combobox SelectionChangeCommitted Event Doesn't Always Change SelectedValue?

Sep 29, 2011

WInforms Combobox SelectionChangeCommitted event doesn't always change SelectedValue

View 1 Replies

Know If An Array Of Lists Contains Similar Items (similar Lists)?

May 20, 2010

I know how to check whether an item exists in a list using (MyList.Contains), But I do not know how to check the whole list. For example (use one button and one richtextbox):

[Code]...

View 14 Replies

Winforms - Know The Event Order Of Form Which Is Executed While Opening Form

Jun 30, 2011

I would like to know the event order of form which is executed while opening form. I am showing my form using following code and the code in form_load event executes twice. Once when the form variables are initialised and second when form is displayed. I want it to execute once only. form showing code:

[Code]...

View 1 Replies

IDE :: Set Project Default For Winforms Projects S/ Default Modifier For Controls Added To Winforms Is Private

May 28, 2010

Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)?I know there's a "modifiers" property in the properties window so I can set it for each individual control however I would like to change the project so from now on myself and other developers have to specifically decide to change from friend to private. (Which I would strongly discourage them from doing).I believe there is no way of doing this, but on another forum a while ago someone mentioned it would be possible with an add-in (but didn't name the add-in or where to get it).

View 1 Replies

Why Are C# And .NET So Similar?

Oct 15, 2010

Also, if they are so similar then why do they exist separately?

View 3 Replies

Control Array - Add New Event - Click Event Code And Calling It A Doubleclick Event

Jul 31, 2010

I've read thru Iceplug's tutorial on control arrays and got it working. I tried to add a new event by basically copying his click event code and calling it a doubleclick event. I used the proper addhandler and assigned the correct name to my sub. I have the click event changing the background color to blue and the doubleclick event changing the background color to green. The background color does not change to green. Why?

Heres the tutorial with my new code encased in asterisks ...

Code:

Imports System
Imports System.Windows.Forms

Public Class form1

[CODE]...

View 7 Replies

API / Something To Use Similar To PrintScreen?

Jun 7, 2009

Is there an API or something I can use similar to PrintScreen?

I want to be able to select everything inside of a panel and then print it.

View 6 Replies

C# - Difference Between Load Event,Activate Event And Enter Event In The Form?

Mar 30, 2009

I am using VB.NET for Windows applications. What is the difference between Load event,Activate event and Enter event in the Form and in which order the above event is executed.

View 2 Replies

Override An Event - TextChanged Event Not To Be Triggered When The CellClick Event Occurs?

Jul 20, 2010

I'm trying to validate a few things in a form I'm building. It has a datagrid with clients info (taken from an access database) and a few textboxes where the user can type some search criteria. The thing is that those same textboxes are used to add new clients to the database and to modify a client's information if one from the datagrid is selected, so I made it that the buttons to insert and modify clients are disabled on load and thenevery time the text on a textbox changes ("TextChanged" event) they become enabled. So far so good. But then I wanted to make it so when a client from the datagrid is selected both buttons become disabled again until the text on a textbox changes (to make sure they're adding a different client and not the same one that was
selected).

I tried using the CellClick event from the datagrid to disable the buttons, but since every time a client is selected from the datagrid the info is shown on the textboxes, this triggers the TextChanged event too, and the buttons become available.So, is there a way I can tell the TextChanged event not to be triggered when the CellClick event occurs?

View 3 Replies

BGW With Similar Coding But Different Approach?

May 18, 2012

I've two BGW with similar coding but different approach, My second BGW shows me "NOT RESPONDING" whenever i try move/click/focus to form while the BGW is running.

VB
RichTextBox2.AppendText("Some Text")
process2.ReportProgress(inc)
My.Computer.Network.DownloadFile(andpic, "pics/" & spliti(0) & nnum & ".png")
My.Computer.Network.UploadFile("pics/" & spliti(0) & nnum & ".png", "ftp://ftp.mywebsite.com/domains/mywebsite/public_html/Pics/" & spliti(0) & nnum & ".png", "users", "password")
WebBrowser1.Navigate("Mywebsite")

I've taken out number of things that i think is causing this error Are they the cause of "NOT RESPONDING" ?

View 4 Replies

Checking For Similar Duplicates?

Sep 4, 2009

I have a web site where users enter company names to use in the rest of the app. However, recently I've noticed that similar duplicates are appearing, e.g. someone will enter EastTec Solicitors another will enter EastTec Solicitors Ltd someone else will enter EastTec Solictors (missed the i out in Solicitors), when there should only be one entry of EastTec Solicitors. What is the best way of checking the database for entries similar to what they have entered? How would you about checking for spelling mistakes as well like the Solicitors one?

View 7 Replies







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