|
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!
|
|
|
|
|
You have to be VERY careful doing this. Because what FormatCurrency returns is being assigned to the same property that fires the TextChanged event, you could end up firing this event continuously and overflow the call stack.
It's a really bad idea to change the Text property in the TextChanged event!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You won't find it in Intellisense since the Binding class isn't available in design mode. You have to create it manually, and wire up the event, in your code. Take a very close look at the example in the previous link I posted. Everything you need is in that example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I would like to know how to implement a hash function in VB.Net. Thanks for you assistance.
|
|
|
|
|
Every object already has a GetHashCode() method, so be sure your really need to do this first.
How you implement your hash function depends on your data, but you can find an example buried in the code for A Fast Diff Algorithm in Visual Basic .NET[^] here on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|