|
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
|
|
|
|
|
hi everyone..
i have a question about vb.net.. actually, i don't understand, how can we upgrade our vb project to vb.net.. what actually the different of these both vb
areon25
|
|
|
|
|
All you need to do is open the .vbp file inside VB.NET and it'll launch the conversion Wizard.
areon25 wrote: what actually the different of these both vb
VB.NET is a TOTALLY new implementation of Basic. There's so many differences that it's just not possible to list them all in a forum. You can find out more information by reading Upgrading from Visual Basic 6.0[^] on MSDN.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi there by the method u told of conversion can the whole project made in VB will be converted automatically to .net either we have used third party Ocx controls?
|
|
|
|
|
Yes, but chances are you'd have to rewrite some code. It's not a perfect conversion.
IMHO, you'd be better off rewriting it from scratch.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Does a textbox control, placed on a form, have a inhereted methid in vb.net to do a alphanumeric validation? If not, what is the easiest way to achieve this? Thanks.
|
|
|
|
|
u can fetch the value of textbox and store in a string variable and perform the validation on the string variable.
|
|
|
|
|
No, you have to code it yourself.
You can make your own TextBox by creating a class, inheriting from TextBox, and adding validation code by handling the KeyDown event and screening out characters that are not numbers.
You can find lots of example by just simplying searching[^] the articles here on CP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please can someone help me... I work with RichTextBox and i want it when i click on url link in it... Then that link what i clicked shows in label!!!
like...
Richtextbox:
is full of links...
-----------------------
l http://www.page.com l
l http://www.rage.com l
l http://www.mico.com l
l http://www.haya.com l
-----------------------
the label stays empty:
-----------------------
l l
-----------------------
when click on link in richtextbox:
i want to label look like that...
------------------------------------
l You selected http://www.mico.com l
------------------------------------
or other link what is selected...
plese help me.
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
Have you seen the DetectUrls[^] property of the RichTextBox control? All you have to do is set this property to True, then handle the LinkClicked event.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
lol i have seen buth i need that when i click on url event then the label gets the clicked url... get it???
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
|
|
|
|
|
So handle the LinkClicked event, get the URL from the event arguments and set the label text with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
 thx
FeRtoll Software.net
--------------------
I fertoll@net.hr I
--------------------
-- modified at 20:03 Sunday 5th March, 2006
my bigger problem is...
_____________________________________________________________________
My school ends 04.03.2006 and i need to make some application for end... i started to do text editor and i want when some of text starts with example("!") then the combobox apears with items that you can insert example
_______________________
| ("!Insert string") |
| ("!Insert picture") |
| ("!Todays Date") |
| ("!Smiles") |
| ("!End all") |
-----------------------
and other thing:
How to when the other form dialog apears and when i click insert on it i want that it inserts a text buth in position where was the (Ibeam). example
_________________________________
| Form1 - Text editor |
|--------------------------------|
| Some text bla bla balsa ssfj |
| Other one texttatdigfjl a |
| |
| More tegjkabsdfn čkssa |
| |
----------------------------------
now i click on insert new and the new forma apears like dialog
__________________________________
| Form2 - Insert text to Form1 |
|--------------------------------|
| |
|Type text to insert: |
||==================| |
| |
| Cancel | Insert|
----------------------------------
i pres insert and i want that the text what i typed is inserted in Form1 - TextBox1 - Selected start where was the (Ibeam).
Please help meeeeeeeeeeeeeeeee...
Thanks
Plus i didnt sleep 2 days... so please help me!
Can u help me with it? 
|
|
|
|
|
FeRtoll wrote: i want when some of text starts with example("!") then the combobox apears with items that you can insert
This is normally done with some kind of Insert menu, not typing. The user leaves the I-beam where the isnerted item will go, then clicks on a menu and picks what should be inserted at that point.
You've complicated your app by trying to do it with typing a marker. Considering your short timeframe, I would suggest dropping this and doing it with the much simpler menu-driven solution.
Part of turning in a project on time is knowning what features are critical to your application and which are "nice to haves". If your "nice to have" features will make your project late, they're not worth putting in. Keep in mind, you're being graded on what you turn in as a finished project.
FeRtoll wrote: How to when the other form dialog apears and when i click insert on it i want that it inserts a text
This is a bit more complicated. You'd have to create a form that allows you to enter some text and click an Insert button. You'd show this form with a ShowDialog call. When the Insert button is click on that form, it should set its DialogResult property with some value that you define, and it should set a public field that contains the text to be inserted.
When the ShowDialog call returns, you'd check the DialogResult return value and act appropriately, using the text in the public field to insert the text.
Form2 should not know ANYTHING about Form1 at all. It's functionality should not care that Form1 even exists and should not depend on the existance of a RichTextBox. This dialog should be concerned with handling a little user input and setting its DialogResult based on which button on that form with clicked.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi all,
I want hijri calender that can be used in both vb6 and vb.net (ready made control will be better)
Thanks for help
|
|
|
|
|
Have to tried Google? A simple search for "hijri calendar control" reveals more than a few results[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|