Handle Form.MaximumBox.Click?
Aug 10, 2009Is there a way to handle form.maximumbox.click in .net 1.1?
View 4 RepliesIs there a way to handle form.maximumbox.click in .net 1.1?
View 4 RepliesI am trying to put a new face on an old C program. The C program is, of course, unmanaged code, designed smartly to separate the number crunching and the interface, and the interface I'm trying to replace is X windowing. The graphics part is where it gets a little hairy, because the C is going to need to continue to draw in my new interface, based on the data the program produces. Even if I want to duplicate that data in .NET so that the .NET side can handle all of the drawing, the fact remains I'm going to need to operate on the graphics window in some fashion from C.
I gather that handles have a lot to do with the bare Win32 graphic operations. Is such a similar handle provided to, say, a PictureBox element in .NET? And if so, is it the kind of handle I can use in the unmanaged code without an issue?
I have tried and tried and tried to google for the solution for weeks now, and all I come up with are either C++ solutions (using object-oriented GDI+) or some sort of extension to the C language.
Alternatively, is there a way I can have .NET create a handle specifically for this purpose of having C draw it?
To sum it up, I am using Visual Basic .NET 2008 and a C DLL (also compiled in VS2008), so far in the little testing I've done, I've been able to marshal complex structures to and fro, but I am not sure how exactly I'd let C do any drawing on the .NET form, if that was even possible.
I want my console application to be able to do one function I have when you click one option on the windows context menu, and another function when you click another option.
View 3 RepliesI have a mouse click event for one of my controls. I then change the text of that control to something. I also have several other textboxes and want to do the same. How can this be done? I thought maybe this:-
Private Sub txtTitle_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles txtTitle.MouseClick, txtTitle2.MouseClick
End Sub
My problem is how do I determine which has triggered the event (title1 or title2).
I have a Toolstripmenu with ten drop-down items in it.(named menu1, menu2, menu3 etc)
I have a sub with ten handles Menu1.click, Menu2.click etc.So clicking on any of the ten menu items calls the sub.But- how do I find out which one of the menu items was clicked?
I want basically:
foo = clickedmenuitem.text
I could do it with ten different subs but that would be a lot more code.Especially since the sub is quite large and I only need to know which item was clicked for a small part of it.
How do I find which of the ten handles for the sub was triggered?I tried handle.tostring but that gave the same string of numbers for each menuitem, that was clearly the wrong command.
I have this code in ButtonClick Handle event but nothing works :/ I was wondering why... I tried msg("") as well as the first line in the code to see if it works but nothing!
Dim myConn As SqlConnection
Dim cmd As SqlCommand
Dim sqlString As String
[code]....
I'm creating <div>'s and appending them to a literal's text property. I have added a <a> element to the text so that the user can click on a specific element. How can I tie that to a function to handle the event in the codebehind (vb.net) ?
Example of my Literal.Text ...
For Each row As DataRow In oDataTable.Rows
MyLiteral.Text &= "<div style='font-size: 8.25px; text-transform:uppercase; padding:3px; background: #FF8C00; border: 1px solid #000; margin: 0 5px 0 5px; display:inline-block; float: left;'>" _
& row.Item("LastName") & " | <a href='#?"& row.Item("ID") & "' style='color: #000;' >X</a></div>"
Next
So the above code I want to somehow allow the user to click the X link and then it would remove that person.
I use ShowBalloonTip method of a TrayIcon class to display a balloon tip. Is there a way to handle a click over this balloon? When i click over the balloon no event seem to be generated, and it only closes the balloon.
View 2 RepliesAm on creation of touch screen UI system.And am generating button for selecting products
Under certain category.
--> array of button creating dynamically And placing in TABPAGE when user selects Tab for category. The button will be created with the name of products, Under the category selected.
{
'the way am creating controls.
mybutton(j) = new button()
mybutton(j).top = 100
}
How can i get the Click event of those buttons-( in the array)....??
I am trying to make a routine that will be called everytime the mouse button is clicked. I want it to be called so that the controls event that the mouse is clicked on is triggered.
For example:
You have a button control on your form. Instead of having the Button1_click event
You have a Control_click event. And that Control_Click event will be used for each control on the form.
I have a UserControl with a Panel (Panel1). The UserControl has a property Items (type ControlCollection) that returns the Controls collection of Panel1.Via a custom CollectionEditor, I tell the designer that it should add my custom controls called Item (inheriting Control). For the sake of example, the Item control is just a control with a random background color:[code]The custom CollectionEditor creates new Item controls using the DesignerHost service (and its CreateComponent method), so that they appear as actual components in Panel1, selectable during design-time just like any other control.It might be a little hard to see (because the colored Items are docked to the top), but I have selected the red item, which can also be seen from the Properties list.
As you can see in the code, I attach a Click event handler to each item as it is added to Panel1. When clicked, a MessageBox shows the color of the item. Obviously this is just for the sake of this example, but the point is that I need to be able to click an item and something then needs to happen.This works fine during run-time. I can click each item, and the MessageBox shows.The problem is that it does not work (quite obviously) during design-time. When I click it during design-time, it is simply selected (as any other control) and of course does not register any Click (nor MouseClick) events.But, I need the Click event to fire even when in design-time! Clicking an item corresponds to selecting it, and when selected (even in design-time), some other panel (not shown in this example) should be brought to the front so it gets visible. Now, I have created lots of things very similar to this (clicking an item during design-time), but there has always been one major difference: those items were not actual controls on the form. Instead, they were drawn manually on to their parent (and they only looked like separate controls). Obviously there was no design-time support for those 'items' (as they weren't controls), but I could handle clicking them quite easily: by handling the MouseClick event of the parent, I can check the location and see if it falls within an item. If so, that item was 'clicked' (artificially).This time, the items are actual controls, and this method does not work (the parent does not receive a MouseClick event either).So, does anyone know of any way to do this? The only way I can think of right now (although I have no idea how to implement it) is to somehow 'listen' to changes in the designer selection.
I am new to this. am wrting a program that uses the parent forms data...
but i am not able to access the parent object and use it with the client data [code]...
I have two forms, "Customer Information Summary" and "Products Sold". They are shown as separate tabs in a MDI window. When the data in "Products Sold" gets updated, I would like an event to fire from that form which could be handled in the "Customer Information Summary" form.
View 1 RepliesI have master page in ASP.NET. I have added two asp controls to master page i.e. _EmpDROPDOWN and _findBUTTON.I have one content page. FindEmployee.aspx which shows result list of employees (Gridview) based on the selection made in _EmpDROPDOWN when _FindBUTTON is clicked on Master Page.I dont know how to read Master Page button click evenet in Content page.How to read master page button click event (VB.NET syntax) in Content Page?
View 1 RepliesIm Using VB 2008. I have MsgBox() statements in all Mouse & Form Click events to TEST & NOTHING FIRES during Form Load when I click on Form or Button Controls !!! The Form Load event contains code for Displaying the Label.Text control many times with changes in the Text to simmulate annimation.
[Code]...
I had created a form(MDI Child) which have 3 to 4 dataset on it. They all are loaded from the database at the form load event and therefore takes too much time to load and show some part of form during that time. When it load completely it shows the whole form. Is there any way that user will see the complete form instead of some broken form.
View 4 RepliesI have the following code to handle keypresses on the form:
Private Sub Form1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Debug.WriteLine(e.KeyCode)
[Code].....
The first time I press any of the arrow keys the code is not executed and a NumericUpDown(NUD) on the form gets the focus. The rest of the times the arrow keys are pressed everything is fine, until I click on a button. Then the problem repeats, focus NUD, then fine.
Do you mean, "opens a file" or "is opened with a file"?
View 1 RepliesI'm writting a class that needs the form handle but there is a way to use it without send it as argument in the class constructor or in a property?I know that the handler is not set until the form is completely loaded so that is another problem too.The basic idea is catch the form handle without pass it as argument and handle the wm messages.
View 2 RepliesWhat is the VB2010 mechanism for obtaining a form's handle?
View 1 RepliesOk i'm loading a webpage in the WebBrowser Control, but what i need to do is manipulate that webpage. Here is the webpage (you will probably need to take a look so you know what i'm talking about). [URL] Now i'm trying to remove the advert at the top of the webpage OR somehow get the handle of the Java applet and set it to an x and y co-ord on my form.
View 2 RepliesI'm trying to use a asynchronous UDP-Port to recieve data on a form.I manage to receive one message at a time(for each click of btnReadData), however if I do this receive in a loop (in order to continously receive new messages), my form seems to be locked.What am I doing wrong?
Public Class FPR2DIS
Delegate Sub dDataReceived(ByVal Data As String)
Dim UDPWorker As New Worker
[code].....
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
Base form baseForm generate an array of childForm (3 fo them). I have one event handler in baseForm which is called when user close each childForm. The problem is that this event handler is only called when the last childForm is closed. When other childForm is closed, the event handler doesn't do anything.
View 7 RepliesI want to achieve the following:
The user drags text from any open window not related to my application ( like firefox or word, for example) onto button1 on form1 in my application. when he/she does that, a new form (called form2 that contains a richtextbox) will open and the dragged text is directly copied (or inserted) into the richtextbox of the new form. button1 has allowdrop set to true. Beyond that I don't know how to proceed.
I tried:
e.effects = DragDropEffects.Copy
But it seems it is not enough.
how to place a visible image in the splitcontainer so it would be obvious for users to see that the area is movable. Like the split container in SplitContainer Class(System.Windows.Forms) which has the gray with
View 6 RepliesI have a vb.net application in which there is a main form. There are around 10 classes each having their own functionalities like tcpactions, fileactions, serialport actions etc. The user interacts with the main form and does certain actions which will invoke the methods in these classes. Now I have a notifications textarea in the mainform and i want to show the current action being performed in those classes and their results in the notifications area.
for example when a user clicks a "Start Process" Button in the form i invoke the method "launchprocess" in a class "ProcessActions". Now this method tries to launch about 7 different process and after launching it sends notification such as "process 1 launched" or if it fails it sends notifications such as "process 1 launch failed".
I currently use event handlers and use them to show notifications but with the amount of events i have to handle it is getting cumbersome and i might have to add even more classes in the future. So is there a better way of handling notifications from other classes.
I've been searching for the answer for a while but can't find it yet. Basically so far I have a simple VB.Net form with one button.I would like to make a class or module that can handle events from the main form. This is my code so far but it doesn't seem to work.
View 6 RepliesI have a standard windows application called winap. I have a com component which acts as an api to the winap. I have a class in winap call classapi which has all the methods that the api calls and all works well. The problem is that one of the methods in my class api needs to get a handle on form elements in the main worker thread. Whenever I try to access an existing form I keep getting null because the for exists in the main worker thread and my api call is in a seperate thread.
[Code]...
I am just wondering how to force the creation of a handle of a control before the form that it is contained on is loaded... I have tried:
[Code]...