|
sir
i am new i cant understand how can change labeltext at runtime please can you send me complete information
thxxxxx
|
|
|
|
|
Hello rashid. Let me explain all the ways in which this post of yours is kind of dumb
1 - if you're talking to someone in another thread, replying to that thread will mean they get an email
2 - if you're talking to someone in another thread, there's no reason to expect they will log on at the point in time that this post is visible
3 - your header, by naming someone, fails to say anything that might attract someone else who could help your problem, even tho it's so trivial that I doubt there's more than 5 people who have ever used this forum, and could not answer you.
4 - intellisense means that even if you're too cheap to buy a book and too lazy to google, you can just put a . after a variable, to see the properties and methods it has, with documentation
5 - in any case, if you have no idea how to approach this problem, I assume you're trying to teach yourself, and you've dived in far too deep. Forget about any sort of forms app for now, buy a book on VB, and learn how basic programming works.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You wrote
<quote>i am new i cant understand how can change labeltext at runtime please can you send me complete information
Me.Label1.Text = "This is the new label text"
And now go read the book as Christian says!
|
|
|
|
|
sir
pls help me
how can i select label or textbox at runtime form on vb.net
thx
|
|
|
|
|
Label1.Focus()
TextBox1.Focus()
My advice is free, and you may get what you paid for.
|
|
|
|
|
Instead of posting a flood of easily answered questions, and then typing in code you don't understand and thinking it makes you a programmer, buy a book and work through it for these sort of absolute basics. If you can't work out this sort of stuff, the odds are low that you're learning anything from the answers, as you have no basis on which to understand anything about programming,.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You want to Set Focus in Text Box or you wants to select the Text in the control, i dont think so Label is a good option here Use rather TextBox.
you can use its Focus Property at run time and at Design Time you can set tab order by going to Menu
View and then clicking on TabOrder
to select All Text in a textbox control use
TextBox.SelectAll()
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
If you read all three of his questions, what he calls a label, IS a textbox, and his issue is that he creates them on the fly, and does not keep a reference to them.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Hi,
I have a VB 6 application which crashes giving system message about the crash.
Scenario:
There is a simple form where there is one text box and 2 command buttons, submit and cancel.The text box is restricted to accept only numeric values. Once valid data is entered into the textbox i press ENTER + (some other key) simultaneously. The entire application crashes!
The ENTER + (some other key) press happens by mistake for sure, but i cant afford to loose all that data because of the crash.
If i knew the exact cause of the crash i could handle that event.
Can you help me out here? Have any of you faced such a situation?
-Shruti
|
|
|
|
|
First, why do you torture yourself with vb6, when vb.net is available and free (Visual Studio 2008 Express)?
Your application crashes after you have pressed enter + (some other key), because enter is not numeric (it is a control key), but it is an actual value entered.
So validate the value entered in the textbox before you use it. At the same time this will prevent the program from crashing when the user copy-pastes a value into the textbox.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Yes i understand, but when i debug i can see the control directly going to the submit button's click event when i press ENTER.
Another point, while debugging i do not get any errors. It crashes only once the application is installed.
-Shruti
|
|
|
|
|
After having pressed enter, and before doing anything with whatever value was entered in the textbox, do you validate the entered value?
What it sounds like, is that the following sequence of events takes place:
1. the user (you) enters "123" in the textbox
2. the user (you) presses the enter key (and possibly some other key as well) while the caret is still in the textbox
3. the textbox now contains the value "123Chr(13)"
4. somehow the click event of the submit button is fired
5. some code executes, that expects to receive a numerical value from the textbox (i.e. 123) but receives "123Chr(13)"
6. crash.
When you debug do you walk through the code all the way to point 5 ?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Yes i do run through all 5 points of the code
|
|
|
|
|
It sounds to me like
1 - you ignored the point that VB6 is obsolete, and skills in VB6 close to useless
2 - you pretty much missed the point being made to you on what you should do to debug it
3 - you probably have code that assumes that you entered a number, when the enter character means the parsing code fails
4 - you somehow expect us to magically fix your problems, despite not posting any code, or even showing signs of knowing which code it is that is blowing up
I think you've got some problems
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You could try to see if you can find out anything about the error by adding some error handling:
Private Sub YourSub()
On Error GoTo ErrHandler
'Your code that uses the value from the textbox here'
ErrHandler:
MsgBox (Err.Description)
End Sub
then compile you app and run it.
My advice is free, and you may get what you paid for.
modified on Wednesday, September 2, 2009 6:55 AM
|
|
|
|
|
Hi,
I am trying to draw a line in picture box control using the following code in the Picturebox Paint Event : -
Dim g As Graphics = MainPanel.CreateGraphics
g.DrawLine(Pens.Red, Convert.ToInt32(0), Convert.ToInt32(0), Convert.ToInt32(190), Convert.ToInt32(190))
But , unfortunately the line is not drawn can anybody tell the reason
Thanks
|
|
|
|
|
Download Visual Basic Power Pack 2 or 3 both available and it contains several controls like Line Shape , Rectangle, Oval Shape and Print form
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Generally speaking the picturebox control is meant to display an image, not to draw in. If you want to draw a line, don't do it in the picturebox but rather on top of it.
Alternatively, you could first create an image of the line and then load that image into the picturebox.
My advice is free, and you may get what you paid for.
|
|
|
|
|
kjsl2k9 wrote: Dim g As Graphics = MainPanel.CreateGraphics
g.DrawLine(Pens.Red, Convert.ToInt32(0), Convert.ToInt32(0), Convert.ToInt32(190), Convert.ToInt32(190))
All of this code is bad. Every last bit of it. Handle a paint event, never call CreateGraphics unless you're drawing a rubber band. Draw directly onto the form, not into a picture box, that's not what it's for. Use the graphics object passed into the paint event.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Please I would like your help in the following questions,(Please supply code example.)
:
1. How can I make a program’s able to link with its database independent of location?
There is a program I am trying to create. It works fine only if the database is placed in a particular location. I would like the program to be such that a user can install the program in any location and my program can look for and locate the database.
In a multi-tier network application, let us assume the following conditions exist:
• The front –end is in VB.NET/ C# .NET. (I am at home with any of them so you can write the code in any of these languages) The back-end is an oracle database.
2. How can I link the two? The front-end is not in the same computer as the database.
3. How can I make my apps able to read/ write real-time data?
Thank you .
ihe
|
|
|
|
|
ihe wrote: 1. How can I make a program’s able to link with its database independent of location?
You will need to have some sort of local data store (or registry entry etc) that records the location of your database. When your system opens, it attempts to connect to the database, if it fails, it prompts the user to locate the database and saves it to the data store (or registry entry etc).
ihe wrote: 2. How can I link the two?
Using Connections.
ihe wrote: The front-end is not in the same computer as the database.
This is standard design.
ihe wrote: 3. How can I make my apps able to read/ write real-time data?
Write your application to get data from the database (through the connection) and display it to the user, then write data to the database when the user clicks update (or save, or do it, or whatever).
|
|
|
|
|
Please can you give sample codes?
ihe
|
|
|
|
|
Please don't cross post. Did you want VB or C# code ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Please in any (Vb.NET or C#.NET). I write in the two languages.
ihe
|
|
|
|