|
Hi,
I am creating a webparts control which consists of a listbox and a label. How do we add the 'items' property to the listbox such that when the webparts control is used during design time,the user can add listitems to the listbox at design time using the properties window? (similar to adding items to vb's listbox during design time)
Below is the code snippet:
<bindable(true)> _
Public Property Items() As ListItemCollection
Get
Return ViewState("AddToList")
End Get
Set(ByVal value As ListItemCollection)
ViewState("AddToList") = value
listbox1.DataSource = value
listbox1.DataBind()
End Set
End Property
When the control is dragged onto the form, the List Item Collection Editor window pops ups when I click on the items property. However, after adding list items and clicking the 'ok' button, nothing appears in the listbox. The listitems are not stored.
|
|
|
|
|
Hi all, I am developing an appln in vb.net. I want to divide the main page into 2 parts. I want to provide a menu at the top of the this main page. When the user selects an option from the menu, the subsequent page should be displayed in the other half of the main page (Similar to what happens in a web page). How can this be done in VB.Net? Is there a concept as frames?
With Best Regards,
Mayur
|
|
|
|
|
Hi All,
I am using a treeview/listview combination. I want to use the treeview selection to populate what appears in the listview. As an additional note, the treeview can either have a list of companies or trades based on a radio button control.
Does anyone have a suggestion as to which event I should use to accomplish this?
I have tried the following;
AfterSelect event - the event appears to kickoff twice - once for the item that it is deselecting and one for the item it is selecting. When switching radio buttons, the event seems to run for each previous item in the list.
BeforeSelect event - does not know which node is selected
Click event - shows me the the last node selected
Any assistance is appreciated - Thank you in advance.
|
|
|
|
|
I'm relatively new to VB.Net and im working on an application that will be using a Virtual Listview control. I've used them before in C/C++. But never in VB.Net, i've searched around for Articles on using them with VB.Net, but i didn't find anything. Can someone get me started? (please note that my listview control uses columns). Thank you.
|
|
|
|
|
Go to Planet Source Code
<blink>There you can find example...
<marquee>| Thats all i can help...  |
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
Hi everybody , I searched for a while before posting here but I can't seem to find a way to make a certain key combination "eg: Alt + A" show or hide the notification icon of my program . For example the "~" key in Bitcomet is used to completely hide Bitcomets Main window & Tray Icon and you can restore it using the same key. Can somebody tell me how to accomplish such a thing or atleast point me to the right direction? Thanks for your time.
Dynamite
|
|
|
|
|
If you're looking to do this when using any application, not just yours, you'd have to implement a global keyboard hook.
Search the articles for "keyboard hook" and you find a few results[^]. The code for these articles is in C#, but is easily convertible to VB.NET.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your help. I'm checking it right now.
Edit: http://www.codeproject.com/csharp/globalhook.asp this article was great! but I can't convert it to Vb .NET, I used the C# offline Converter by Kamal and it didn't work. Could someone please help? Thanks again for your time & effort.
Dynamite
-- modified at 5:21 Monday 6th March, 2006
|
|
|
|
|
I have written the code, my next step is to produce a setup exe to install on other PCs. How is this done?
|
|
|
|
|
Just use a setup and deployment project.
Add all the files needed and thats it.
|
|
|
|
|
Batter is that you build the project in relese mode not debug... and then make setup program with Ino Setup! My suggestion is that.
<marquee>I work like that, Easy, Quick, Clasic, Not complicated... :->
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
|
go to new project and select 'setup and deployment projects' from the left pane. and then u can either select 'setup wizard' or any other template as per your convenience. Before that test ur software for any bugs.
|
|
|
|
|
|
Is there a way to format a textbox control at design time?
For example:
The database contains a string of 9 characters, and I want to display the following:
xx-xxxxx-xx
Or I would like to display a textbox that only displays currency values, without using the format currency method.
Thanks!
|
|
|
|
|
No. The TextBox doesn't support formatting at design time. You have to use the String.Format() method to set it's Text property or you have to use a different control, such as a MaskedEditBox.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
Thanks for the response. I have a problem however. I have some "money" type values in a database that I would like to format as currency on a form. I'm using bound controls and a dataset and when the form loads for some reason it doesn't apply the textbox.Text = FormatCurrency(Textbox.Text). Is there a better way of doing this?
|
|
|
|
|
FormatCurrency won't work with Strings. You have to pass it a number to format, which will be returned as a String.
You'll have to use a Binding[^] class to intervene when the data is bound. You'll handle the Format event of the Binding class where you'll get a value and you have to format it and return the equivilent String. There's a couple of examples in the link.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Can you be more specific, I am using TextBox.Text = FormatCurrency(textbox.text) on form load, however, the textbox is not formatting. If I apply this to another event (cbobox.selectedItemChange or LostFocus) it will then work. But not on form_load.
|
|
|
|
|
Dave,
I just realized the reason, however, I don't know how to fix it. This form is being called by an MDIParent. If I set the child form to the startup object it displays the currency, and applies the cbo.selectedindex = -1 properly. However, if called by the parent it ignores these (and I'm sure other commands). Would you know why?
|
|
|
|
|
I'm really confused as to what you're doing now...
But, you're probably passing an empty string to FormatCurrency while in the Form_Load event. Set a breakpoint on that line and see what the value of Text is before you pass it to FormatCurrency.
Databound controls won't get their values until AFTER the Load event handler is completed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I apologize if I'm not clear. But, I think you've derived to what I'm attempting to do.
I have a form being populated by a DataSet, generated by a SQL DataAdapter. The Data Adapter is filled on Form_Load. Some of the bound controls on the form are for displaying currency amounts, however, the initial fill doesn't display as such. My initial question was: how do I format these controls, if not at design time. You mentioned the FormatCurrency() method. If the controls are bound, and the dataset is filled at form load, are there other event handlers that are fired between when the form is loaded and when the controls are displayed? If not, when can I issue the FormatCurrency() method?
|
|
|
|
|
The only other event that is fired after Load is Activate. But, in either case, FormatCurrency was not meant to be used in the way you're trying to use it.
You'll have to use the Binding class to do what you want. When the data is sent to the TextBox through the binding, it makes a stop in your Format event handler first. You format the data how you want (this is where you would use FormatCurrency) in the Binding.Format event handler, then the resulting string is sent to the TextBox, not the original data.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your help.
When do I find this event handler? I only see BindingContextChanged. Sorry, a newbie (obviosuly)
|
|
|
|
|
Dave,
Thanks for your assistance! I'm now using the TextChanged event, which seems to be working. Thanks again!
|
|
|
|