|
Why would you want to ? If they never enter the textbox, you KNOW if it's valid or not, right ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
nop!
If I put some code in the validating event ... i don't want to put again some code in the button_click event (check if some textbox is empty) you see???
Dan
|
|
|
|
|
In that case you need a requiredfieldvalidator. If you're in a winforms app, you may need to force validation on a button press, as the model is not as clear as ASP.NET
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
ok Thanks Christian
I have 2 years experiences with asp.net but only 1 month with WinForms .... Why asp.net have a lot of validators and not in WinForms we need to code every thing :S
|
|
|
|
|
Because in WinForms we have state, we're *able* to program a lot more.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
You might want to take a look at an article on MSDN, called Validator Controls for Windows Forms[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thank you Dave excellent article
Dan
|
|
|
|
|
HI, im currently doing a recognition system that constructed by using Matlab, but i use VB as interface. Does anyone know how to let the VB open other program and execute the file? i try as followed but it shoen type mismatch
Set Matlab = CreateObject("Matlab.Application")
when i try to debug it shown error on this line. Hope that anyone can help Thank you.
best regards
Snow
|
|
|
|
|
You haven't shown us enough code to diagnose the problem. It would appear that your definition of the variable Matlab is causing the problem.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am in an advanced VB.net 2003 course. I have created a database to store DVD information in. The database is Access. I have a picture box that I would like to have the front covers of my dvd's put in. What exactly I am trying to do is:
If a dvd is already added to the database but the pic is not in there, I would like to be able to do a drag/drop from the pic directly into the form.
For new dvd's being added, I would like to know a way to get the new pic into the form.
And I would like to be able to make sure my access db is set properly to take those images and keep them in their database so when someone scrolls through their dvd's, the pic will change with the dvd.
Any help on this would be greatly appreciated! Thank you all.
Jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
I would personally opt for keeping the graphics out of the DB and stored locally in the file system oswhere. Only keep a path tot he pic in the DB. It just avoids problems latter whenteh DB gets large.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Could you provide me with some insight for this procedure on what I am wanting to do. I understand storing them locally but how does the form know where to pull them from (a default location) and how can the drag/drop work with the pic box (if possible)? Thanks for the quick reply.
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Your code knows what directory it is being run from so use that as a base to start from. Create a folder under that folder to store the images as individual files there. As you add a title into the system take the picture provided (how are you going to get them?) and save it there. Take the filename you save it to and add that to the database. Any time you want to reference the picture just take the filename from the DB, append it to your known path and load the picture into your picture box.
As far as the drag and drop goes, I am not sure why that enters into it unless you are using that as a way to get your pictures into the program. You might want to consider grabbing the pictures from IMDB. It might take a bit to learn how to do that but you won't have to worry about scanning them in yourself.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
thanks for all the help. I still have a few more questions regarding all of this. I am very new to VB.net programming so I understand what you are saying but the follow through is where my problems lie.
I guess to start at the lowest level:
How does Access handle the pictures? Let's say I have pictures that I scanned in and they are sitting in a folder somewhere. How does access tie into them? Are they OLE objects or hyperlink (what is the datatype for that column?).
Next, am I just wanting to bind the pic using the picbox property or is this something that I will need to code?
I could send you my VB.net file to view if that will help. I can zip up the entire project and send it over to you. This is something I am definitely interested in learning and I hope you don't mind helping.
Thank you again.
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Well, I could give you a fish, or show you how to fish…. Hmmmm
Purpose is to demonstrate using xml as a file type database
http://www.codeproject.com/vb/net/OrderAutomation.asp[^]
Base64 Encoding a picture for storage
http://www.dotnet247.com/247reference/msgs/57/288330.aspx[^]
As far as storing the picture goes in the example I gave you, the DB only stores the NAME of the picture (as a string) then uses that name to load the picture from a file to view it.
I don't mind helping, but I hope you understand why the answers I give are the way they are.
Part of being a developer is:
Solving problems by deciding what way is best.
Decomposing problems into small understandable parts.
Finding solutions to problems.
I don’t mind pointing in the direction but you have to do a little of the work yourself. That's what makes programming so much fun.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
I understand and completely agree with you. I do appreciate your help; I just wanted to make sure we were on the same page. I get a bit frustrated with myself on some of these things because I know what I want to do but I have trouble mapping it out and implementing my ides (when it comes to programming). I will read up on those articles and let you know if I have any questions. Thanks!!!
jason
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Oh, on emore thought.. You might want to consider using XML for your DBa nd just base64 encoding the ppicture inside there...
Maybe....
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
How would I go about using XML for my dB? Also, I have not heard of base 64 encoding...could you elaborate? Thanks!! I appreciate all your advice.
I'd rather have a bottle in front of me than a frontal lobotomy.
|
|
|
|
|
Is there any way in which i can use a image that is not rectangular as windows form button?
|
|
|
|
|
Hello All,
Does anybody have any neat code (VB.NET) to manage the "recent files" part of a main menu like in WORD. I'm using just a simple note editor and i'm going crazy over the logic although i'm sure it's simple.
To start with I read in 4 files from a *.ini file and create the menuitems having declared the menu array name at form level:
'at form level
Dim RecentFile(3) as MenuItem
'at frm_Load to create menuitems after reading file names/path from *.ini file
...RecentFile(3)=New MenutItem (FileString(4))
Read files then create menuitems..
mnuMain.MenuItems.Add(RecentFile(I))
Then from the Open file event using the OpenDialog box..I have
Filename=dlgOpen.Filename
This then passes to a subroutine to sort the recent files and delete any file that was the same as the current one.
so..
FileString(1)= RecentFile 1 from last edit/open/new procedure
FileString(2)= RecentFile 2 from last edit/open/new procedure
FileString(3)= RecentFile 3 from last edit/open/new procedure
FileString(4)= RecentFile 4 from last edit/open/new procedure
I'm looking for code that puts the new Filename in the top position but also deletes any of the existing ones if they are the same as Filename.
Thanks for your help.
|
|
|
|
|
Case:
Form1 has a button. In button I declare object for my Form2. Opens form2 with .show method. On form2 I have a button. When pressed I want to pass a value back to a textbox1 on form1 and then close form2.
Simpe as that ...
Was an easy way in VB6..... how about VB.NET?
Please help...
//Maw
|
|
|
|
|
When you open form2, open it with .ShowDialog() instead. After that line, you can pick up any Public properties off of form2. Easy... Then you have to make sure you .Dispose() your form2 object.
Dim frm2 As New Form2
frm2.ShowDialog()
' ... User does whatever on Form2. When OK is clicked, form2 disappears
' and control is returned to here.
TextBox1.Text = frm2.whatEver
frm2.Dispose() ' DO NOT FORGET THIS LINE!!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks! ....
But if I want to change something on form1 live ... In my case I use a scrollbar and want to set a value to a textbox on form1 ..... I want to see the value on Form1 change when I change my scrollbar on form2....
Hrmmz ... Is this possible?
//Maw
|
|
|
|
|
There's a couple of ways of doing this.
One is to expose a public sub on Form1 that makes the changes you need. In order for Form2 to call this, you'd have to pass a reference to Form1 on to Form2 using a public sub on Form2. This sub would store the reference somewhere at the class level so all the code in Form2 could use it.
The second way is to add a couple of events to Form2 and fire them off when the data changes. The event handlers on Form1 would have to take any data passed in the event to make the necessary changes in Form1.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You can use a sub main in a module, where you declare a public form1
public f1 as form1=new form1
in the sub main:
application.run(f1) ' or f1.showDialog()
so f1 will be accessible from all other form.
note that the object you want to change in form1 will be declared as public also.
if you want to modify a textbox in form1 so:
in form1:
public withevents Text1 as textbox
so from any other form you can write:
f1.Text1.Text="Any Text"
OmarMallat
|
|
|
|