|
You don't need to add controls dynamiclly...
You can simply resize the form so that if you don't want to show them they are hidden and then when you want to show details you simply make the form big enough that all the controls are shown...
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello EveryOne,
How to allow only numeric values ina textbox.if we allow characters it should pop up a message showing "need to enter numeric values".
Please HElp Regarding this,
Thanks
Nagalakshmi
|
|
|
|
|
Hi,
I don't know if this is the best way of doing it, but you could capture the textbox on change event and then loop through each char in the text field to check if it is a number or not.
So something like this:
<br />
Public Sub OnTextChange(Byval sender as Object, Byval e EventArgs) Handels T.TextChanged<br />
<br />
for each c as Char in T.Text.Chars<br />
<br />
if Not c.IsNumber Then<br />
MessageBox.Show("Bla bla bla")<br />
<br />
end if<br />
<br />
Next<br />
<br />
<br />
End Sub<br />
<br />
Hope this helps
/Johan
|
|
|
|
|
u can also do this on keypress event of text box
Private Sub txt1_KeyPress(KeyAscii As Integer)
dim strValid as string
strValid = "1234567890"
if instr(strValid , chr(keyAscii)) = 0 then
keyAscii = 0
end if
end sub
It would help u not to enter any character other than numeric values
Noshaba
|
|
|
|
|
Rather than annoy the user with a popup message which theyneed to discard every time they type an incorrect character, you should really restrict the characters that can be entered in the first place.
There are plenty of articles/posts on this subject here at CP if you search.
|
|
|
|
|
I built a little function:
function CashVal (byRef Intext as object, byRef ErrInd as boolean) as double
1. Check Intext to be sure it's not nothing
2. Check Intext to be sure it's not null
3. Check Intext to be sure it's numeric (and in my case, > 0...)
4. Return CDbl(Intext) and an appropriate ErrInd.
I invoke this (x = CashVal(textboxname.text,Error_Indicator) )when the "leave" event is fired, so the user can type anything, and it's evaluated as a whole. The event handler checks to see if there was an error. If not, it sets the text property of the text box to format (x, "currency"). If there's an error, obviously, it can react appropriately.
|
|
|
|
|
http://www.cambiaresearch.com/cambia3/snippets/javascript/browser/allownumbersonly.aspx
|
|
|
|
|
One of easy ways....
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress<br />
If (AscW(e.KeyChar) < 48 Or AscW(e.KeyChar) > 57) And Not e.KeyChar = Chr(Keys.Back) Then<br />
e.KeyChar = Nothing<br />
End If<br />
End Sub
Regards,
Chatura Dilan
|
|
|
|
|
hellow to all ..
i wanna count in crystal reports field that have boolen values , but i wanna count them when they are true ..
how can i do this ?
|
|
|
|
|
I am useing DataGrid
VB.NET ,WINFORMS
I want to place Buttons/Hyperlink for a entire Coloum when grid is displyed
i had done some coding but, the but is displyed in ACTIVE Cell only,
but i want it to be disply by default in entire column
Any Advice/Suggestions.../links
Thanks in Advance
-- modified at 2:37 Wednesday 12th April, 2006
|
|
|
|
|
Friends the best Reference for my question,
if any is in req of this type of solution, pls do vist this links
its very simply & easy then wht v actually guess
http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/datagridcolumnstyle1
http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/datagridcolumnstyle2.asp
With Best Regrads
Electron
|
|
|
|
|
Friends the best Reference for my question Regrading datagrid,
if any is in req of this type of solution, pls do vist this links
its very simply & easy then wht v actually guess
http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/datagridcolumnstyle1
http://msdn.microsoft.com/smartclient/default.aspx?pull=/library/en-us/dnwinforms/html/datagridcolumnstyle2.asp
With Best Regrads
Electron
|
|
|
|
|
Dear All...
Please help about it.
I have 1 PS2 keyboard and 2 USB Keyboard Connection in my computer.
I want to write a samll Program that is Checking keyboardID.
When user press key , this program can display Keyboard..
Zawlat
|
|
|
|
|
zawlat wrote: I want to write a samll Program that is Checking keyboardID.
Too bad the system doesn't differentiate between them. When a key is pressed, there is nothing in the message to say which keyboard it came from. You'd have to write your own filter driver that sits just above the keyboard drivers to expose something like this. You can't do this in Managed Code. This is the domain of C++ and the Windows Device Driver Development Kit.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi friends
i am working on ms access front end, i have Edit form which cotains a combo box this combo box is bound with a table named Department, this combo box have names of departments which have entered in the table, i want at run time when i select a department name from this combo box other information related to this department will be display in respective text boxes of the form.
i am using the following code it gives a etrror there
Private Sub cmbSectorName_Change()
Dim rst As ADODB.Recordset
Dim ch As String
ch = cmbSectorName.Value
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open "Select Description From tbl_Sectors where Name=ch", CurrentProject.Connection, adadOpenKeyset, adLockOptimistic
txtDeptDescr.Text = rst.Fields(0).Value
rst.Update
rst.Close
Set rst = Nothing
MsgBox "Data Has Shown Successfully"
End Sub
when i change selected name of the combo box it gives error "No Value given for one or more parameter " and get focus to this line fo code
rst.Open "Select Description From tbl_Sectors where Name=ch", CurrentProject.Connection, adadOpenKeyset, adLockOptimistic
friends kindly can soem help me
and second this it that after this i want to allow user to change soem information of this selefcted department and then on click event of Edit button it will updeated in data base
i need ur help regarding these two problems may u guide me
regards
Farooq Azam
|
|
|
|
|
Hi,
I am facing prob in searching a perticular text in a web page. I need some help.
Kashif Ashfaq
|
|
|
|
|
We need more information before we can help you.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Why should you be considered for the job? (i.e. what benefit can you bring ...(continued)
This is the interview question can u give me some opinions??
|
|
|
|
|
You have got to be !@#$%^& joking?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
If you are going to post all your interview questions why do you post them one at a time? Just post the whole thing and be done with it.
/Johan
|
|
|
|
|
Shouldn't someone ban or at least restirc acces for a month to this user??
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
So why are you replying to me? I'm not the guy who posted this stupidity.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Sorry, I guess I pressed the wrong post. My mistake, I won’t do it again, please forgive me for this if you can possible find it in your heart to do so.
|
|
|
|
|
I will, but only if you can forgive me for my impatient replies.
This guy has really stirred me up.
Cheers.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Beacuse I don't know anything about the job, so that I have to ask questions on forums even to be able to fill in the interview form.
---
b { font-weight: normal; }
|
|
|
|