|
Christian Graus wrote: Is that VB specific terminology ?
I thought it was general .NET terminology.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
|
Thank you Christian,
I appreciate you patience, Have tried Googling many things first but get overloaded with info and have trouble with info burn-out.
The manuals for VB.NET never seem to lay out the data completely. They touch on things and run off in all directions never completing all the info on the topic so that I can fully grasp it.
Once again,
Many Thanks Mate!
Frank
|
|
|
|
|
frankiebaby2 wrote: Dim:- Can be used to declare variables within the entire Form if placed before all the Private Sub crap, other wise known as the General Declarations area. Otherwise is for Local Variables only.
Dim declares variables and specifies their types and a possible initialization values.
frankiebaby2 wrote: Static:- When used with a Local variable, the value is preserved for the lifetime of the application (while the program is running).
Declares a variable as "persistant" between calls. For example, if you have a sub that is called many times and a variable in it is declared static, it retains it's value between calls. The variable is not destroyed and recreated to an intialized value. This can only be used at the procedure level.
frankiebaby2 wrote: Public:- Must be contained in a standard Module not a Form and are visible throughout the entire project. (A Module is a Form without a user interface.)
Specifies that a variable is visible outside the scope it is declared in. Public can only be specified at the namespace, module, or file level. Specifying Dim is optional.
frankiebaby2 wrote: Protected:- (Your answer goes here )
Protected variables or procedures are only visible to the class they are declared in or in derived classes.
frankiebaby2 wrote: Friend:- Access is similar to Public, only Friend is restricted to only code within it’s project (application).
Friend means that the element is only visible to code inside the same assembly (.DLL, .EXE) as the Friend element.
frankiebaby2 wrote: Shared:- (Your answer goes here )
Only a single instance of the Shared element exists and it exists without an instance of the class it's declared in.
frankiebaby2 wrote: Protected Friend:- (Your answer goes here )
A combination of the two above.
frankiebaby2 wrote: Private:- Appears to be the same as Dim. Is it? (Your answer goes here )
Declares the element is not visible outside the scope it is declared in. For instance, Private members of a class are only visible inside the class and any code in it. It is NOT a replacement for Dim.
The complete variable declaration line looks like this:
[ <attributelist> ] [ accessmodifier ] [[ Shared ] [ Shadows ] | [ Static ]] [ ReadOnly ]
Dim [ WithEvents ] variablelist
You do not have to have an attributelist.
You do not have to specify an access modifer, Public, Private, Protected, Friend, Protected Friend. If not access modifier is specified, Private is assumed.
Everything I just wrote, came from here[^].
|
|
|
|
|
Thanks Dave,
I am glad there are people like youself who can take the time to explain these things to inexperienced people such as myself.
A programmer I will never be, but if I am close to having enough education to write a program that will give me more time to spend with my family.
Frank
|
|
|
|
|
can someone help me about making the codes for a game...similar to the "star of david"
|
|
|
|
|
What is 'star of david' ?
Obviously, no-one is going to answer this, because the question is too broad. The best we can do, is give a broad reply. You want to install DirectX if you want to write anything but the most trivial of turn based games. It comes with plenty of examples you can work through. If your game is simple and turn based, then you should be fine using just GDI+.
Either way, make sure you know VB well before you embark on a game project, games are amongst the most complex things you can try to write.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Your request is too vague. You need to be specific. Even a game as simple as noughts-and-crosses (tic-tac-toe in some parts of the world) would be too much to answer for a forum post.
You should start by planning your game. What are the rules? What do you need to display on the screen? Is it a single player game, or multi-player? Will you compete against the PC or a player across the internet?
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
A lot of your posts are obvious homework questions. If you are not willing to do the work yourself, drop out of school now.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Hi
i am working in VB.net using .net 2.0. i have a requirment to disable a listbox control's single item ....i searched msdn which says..
"You can disable an item in a list box or combo box by adding a single backslash to the beginning of the expression. "
i tied the following code
ListBox1.Items.Add("good")
ListBox1.Items.Add("\bad")
but it didn't worked and "bad" did not appeared disabled..
dispite this my requirement is to disable an item when mouse double click event occurs...
hope someone will come with solution
Faith is higher faculty than reason..
shaz jazz
|
|
|
|
|
A listbox contains listitems. The listitem object has an enabled property on it. Find the correct listitem and mark the enabled property to false. There is a double click event on the listbox. The sender passed it should be the listbox. You should be able to cast the sender as a listbox and get the selectedindex. Use the selected index to get the listitem and set the enabled = false.
Hope that helps.
Ben
|
|
|
|
|
kubben wrote: The sender passed it should be the listbox. You should be able to cast the sender as a listbox and get the selectedindex. Use the selected index to get the listitem and set the enabled = false.
but its not possible because there is no class in whichi save that item further there wasn't any need to use selectedindex for selecting item but i can use selecteditem for such purpose..
so the origanl question is as it is...
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
So using SelectedItem would work fine too.
inside the method you would have:
DirectCast(Sender, ListBox).SelectedItem.Enable = false
Pretty sure that should work.
Ben
|
|
|
|
|
no its not working at all.. i did just as mentioned..it gives this exception message
"Public member 'Enable' on type 'String' not found."
its windows application i hope you are not misinterpretting that its web application.
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
Would you post your code, so I can see what you are doing?
Thanks,
Ben
|
|
|
|
|
sure here it is:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ListBox1.Items.Add("good")
ListBox1.Items.Add("bad")
End Sub
then here is 2nd chunk of code:
Private Sub ListBox1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseClick
DirectCast(sender, ListBox).SelectedItem.Enable = False
End Sub
hope you'll get to the problem.
Thanks..
|
|
|
|
|
Well, I guess you were right I was remembering the web control listbox. Still I think you can get something to work. The listbox has a SetSelected method on it, which takes an index and true or false if the item should be selected. So I would suggest you keep track of the index of the items that are double clicked and then on the click method check to see if they just clicked on one of the indexes that is not suppose to be selectedable and then call the SetSelected method and set that index back to false.
Hope that helps.
Ben
|
|
|
|
|
ok thankyou very much, your idea wud be indeed helpfull.
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
now i made this code
cmd.CommandText = "select distinct * from reglz where fatrname LIKE '%" & TextBox1.Text & "%' "<br />
DataGridView1.Refresh()<br />
<br />
ad.SelectCommand = cmd<br />
ad.Fill(ds, "reglz")<br />
DataGridView1.DataSource = ds.Tables("reglz")<br />
this code will give me some data in the datagride
so what i need to do now is ,to select a number of records to edit in the "fatrname" filed
from datagrideview
but after i select these number of records i dont know how to edit all the field of this "fatrname" or any field for all the records that i select
please help me
very importnat
|
|
|
|
|
1 - use real variable names
2 - this code is ripe for SQL injection attacks, you should read up on this and fix it
3 - try using sensible subject lines, so people know what you want
At the end of all that, I'm not sure if a datagridview supports editing fields. What does google say ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Almost all his posts are 'help' or 'urgent.' He's now on my list.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
I am creating deployment setup for windows based application by cutomising deployment project, using User Interface editor and Custom Action editor.
In my custome action i want to know the path(location) at which this application is being install.
Basically when setup program runs the first screen pop's up and ask user to select the location to install the application. This path i want to access in my later custom actions.
If any one knows how, please kindly let me know. I appreciate your help.
Thank you very much.
|
|
|
|
|
Hi forum,
i like to create a UserControl with some textboxes, buttons and so on.
This is no problem, starting with a UserControl project, placing the textboxs, buttons on the control panel, compiling, adding the dll to any project. It works perfect.
My problem now is: Placing MyUserControl on any form, it is possible to code in the calling form MyUserControl.Controls.Items(...).... to get a collection of controls.
Using this collection, it's possible to get direct access to all controls placed on MyUserControl.
Who to prevent direct access from any forms to the controles placed on the MyUserControl using the Controls Collection ?
Any comments pls ?
|
|
|
|
|
There's really no way to stop people accessing your controls this way. Why would you want there to be ? I mean, if someone starts manipulating the controls on your control, then that's their problem.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you for your quick reply, this answer i expected, after some testing, that there is no way.
Why to prevent modifying the control - well, isn't a control just some code for any specific task? Istn't it better to prevent modifyiny?
But ok, you are right, people modifying an control my be it's there problem .....
|
|
|
|