|
how to enable the pop up window?
|
|
|
|
|
In VB or Vb.net?
In VB Create Menu then visible False. Then use POP UP Menu code.
Code is: -
This Code using in Mouse Down Event.
If Button = 2 Then
PopupMenu ComPort 'ComPort is Menu Name.
End If
In VB.net.
Use ContextMenuStrip build menu then use.
If e.Button = Windows.Forms.MouseButtons.Right Then
Me.ContextMenuStrip1.Show(x, y)
End If
To Enable and Disable Use Menu name and Enable Property.
comPort.Enable = True
modified on Thursday, February 19, 2009 12:18 AM
|
|
|
|
|
hii..i can create a new form..but how to send data from a form to another new form?..thnks
|
|
|
|
|
There are a few ways to do it...
1) Overload the second forms constrictor to provide arguments that you need to pass to the new form as it is created.
2) Provide property getters on the other form so that once you create an instance of it (but before you show it) you can set the properties you need to pass your data across.
3) Provide an Initialize (or other name) method on the new form that has arguments you can use to pass you data along once you create the forms instance but before you show it.
Personally I think these are in the order of best to good, but that is up to you and what your needs are.
|
|
|
|
|
Hi,
I have a toolstripcombobox with auto-suggestions according to listitems in it. My aim is to find the selected item in the listview and highlight it. I am able to select it but I am not able highlight it because lostfocused for toolstripcombobox doesn't happen. How could you do that? I tried invoking listview1 but it didnt'work out.
Thanks.
Private Sub ToolStripComboBox2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ToolStripComboBox2.SelectedIndexChanged
Dim ICount As Int32 = 0
ListView1.SelectedItems.Clear()
For Each LItem As ListViewItem In ListView1.Items
If LItem.SubItems(7).Text = ToolStripComboBox2.SelectedItem.ToString _
Or InStr(LItem.SubItems(7).Text, ToolStripComboBox2.SelectedItem.ToString) > 0 Then
ListView1.Items(ICount).Selected = True
Exit Sub
End If
ICount += 1
Next
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
modified on Wednesday, February 18, 2009 6:45 PM
|
|
|
|
|
Clear the selected items first (there may be 1 or more of them)
do your loop except change this
JUNEYT wrote: ListView1.Items(ICount).Selected = True
to
LItem.Selected = True
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It doesn't work either. When you click the toolstripcombobox, it gets focsed. When you select an item it the list, the matching record in listview should be highligted at same time. It doesn't highlight it the row in the listview.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
pleaze help me in infrared communication on the mobile phone
IRCHAT
pleaze help me in this project
|
|
|
|
|
Worst thread ever.
Prepare to be bombarded with insults.
|
|
|
|
|
Help you with what?? We really can't copy a book into the forums to describe how IR comm works.
|
|
|
|
|
Hi,
welcome to CodeProject.
as you are new to this site, I suggest you show you have spent time and effort to get some things done, and then ask specific questions about the thing you are stuck at. People here don't react well on a general "I need so and so, please help" type of question.
Also always use Google to search information, the answer you seek is probably already present somewhere.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I am beaming the answer from my infrared port, prepare to download the transmission.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
plaese any one help me to understand how to use timer in vb.net
thanks![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
Which Timer? There are three of them.
Though, you're most likely talking about the one in the ToolBox. All you do is drag it onto your form, then write code in it's Tick event.
Somewhere in your code, you need to set the interval to tell the Timer how often to fire the Tick event, in milliseconds. Then you set it's Enabled proeprty to start to start the Timer.
|
|
|
|
|
I am visually inheriting a form.
The base form has a MyBase.Load event.
The child form has a Me.Load event do both of the get executed and if so is this the way I should be doing this?
The MyBase.Load event needs to always be executed but there are also things that need to happen that are specific to the child forms this is the reason for the Me.Load.
I also am wondering why I cannot change the Me.Text property on the child form without doing it in code.
If I write Me.Text = "foo" in the Me.Load event it works but if I try to set the Text property in the designer it give me a object not set to an instance of the object error.
Thank you for your time.
Humble Programmer
|
|
|
|
|
Just a word fo caution: The forms designer doesn't work well with inherited forms.
To answer your first question, no, only the Me.Load event get's fired. You have to explicitly call the MyBase.Load event from your Me.Load with
MyBase.Load(sender, e)
Exactly when you do that depends on your implementation. You can do it as the first line in your Me.load handler, somewhere in the middle, or as the last line in your event handler.
|
|
|
|
|
I am seeing that it is not working well. Are there people who are successfully using it that you know of?
I am very interested in using the visual design because in my case I have a reporting application that has about 300forms in it and they are not exactly the same but about 200 of them are very, very similar. What I would like to do is to design a base form with all of the standard stuff on it and then in my inherited form extend it to include a few other things.
For instance my base form will have a grid and a header and on some of the child forms I will also need a radio selection.
Is there a different way that I am not aware of for handling multiple forms like this without duplicating the forms and or code?
Humble Programmer
|
|
|
|
|
I've only had to do it once, and only on a few forms. Instead of drowning in "workarounds", I just created the based functionality I needed in a couple of user controls (header and footer) and dropped them on each form that I needed. That made things go much smoother...
|
|
|
|
|
Dave Kreskowiak wrote: Just a word fo caution: The forms designer doesn't work well with inherited forms.
I use it all the time, hadn't had to much problems with it, some minor things that needed tweaking but turned out to be bad programming on my part .
What are the problems you'v encountered with it? So I can avoid it if possible.
Dave Kreskowiak wrote: To answer your first question, no, only the Me.Load event get's fired. You have to explicitly call the MyBase.Load event from your Me.Load with
Depends on whether the child form has the load event. If that isn't present the parents load event will be called if it is present the child from has to call it like you said.
|
|
|
|
|
programmer_vb.net_c++ wrote: I also am wondering why I cannot change the Me.Text property on the child form without doing it in code.
If I write Me.Text = "foo" in the Me.Load event it works but if I try to set the Text property in the designer it give me a object not set to an instance of the object error.
How exactly do you have your child form set up? because I use inherited forms a lot and never encountered this problem.
Which version of VS?
Do you override the text property in the parent form?
Do you get errors opening the designer view of the form?
What I have noticed (don't know if its specifically because of inherited forms or not) is that you sometimes have to close the designer view and reopen it to get it to display correctly, this is most common after a run off the project while the designer view of the form is active. (You'll get empty screens/ errors that make no sense/ ...)
|
|
|
|
|
This is some of what I got. It was a few years (?) ago, because I only write an app like this every 4 or 5 years. The last time I tried it was under VS2003.
|
|
|
|
|
Dave Kreskowiak wrote: VS2003
And they still haven't fixed it
Well for me it hasn't been such a big problem more like an irritation, I just have to remember to have code displayed when running a project and all is well then .
|
|
|
|
|
I started with a base form designed the labels print, cancel etc two grids that do the same thing on alot of the forms.
I am using Visual Studio 2008 3.5
I am unsure what you mean by override the text property in the parent form, is that something I can do in the designer or do I need to modify the generated code...
I was getting an error in opening the design of the form but resolved that by checking to see if I was in design mode before letting some of my routines run from the load.
Although I have fix the errors that I was getting in the designer now I am not getting errors when I add to the child form new controls they just disappear.
Humble Programmer
|
|
|
|
|
programmer_vb.net_c++ wrote: I am unsure what you mean by override the text property in the parent form, is that something I can do in the designer or do I need to modify the generated code...
In the parent form:
Public Overrides Property Text() As String
Get
Return MyBase.Text 'change this
End Get
Set(ByVal value As String)
MyBase.Text = value 'change this
End Set
End Property
If you do that (and change the lines indicate) you override the text property.
programmer_vb.net_c++ wrote: Although I have fix the errors that I was getting in the designer now I am not getting errors when I add to the child form new controls they just disappear.
This is really weird behavior, never had that happen to me.
I would take the following steps in finding out what happens:
-Close all open windows (code/design windows)
-Clean solution
-Rebuild solution
-restart VS
--> test if it works now
if not:
-create new project
-import parent form
--> test if it works now
if not:
-create new project
-create (simple) parent form (start with a blank one, and then add the controls you want/need)
--> test if it works now
If it works on the last step, my guess would be you have a reference doing something strange. I know its far fetched but I had some very weird behavior with a previous (very bad) component we used.
Let me know if you find a solution or not, in the mean while I'll go tru my early notes and see if I didn't have something similar in the past.
|
|
|
|
|
I am using
If DateSelectionRadioButton.Checked Then
transactionDataView.RowFilter = String.Format("TranDate >= '{0}' AND TranDate < '{1}'", FromDateDateTimePicker.Value, ToDateDateTimePicker.Value.Add(New TimeSpan(23, 59, 59)))
End If
to set a rowfilter to a dataview via two datetimepickers. However, if TranDate is the same for both the start and end date dates no rows are displayed.
How can I correct this please?
|
|
|
|