|
You need to change the solution properties.
VS2008:
1) Right-click project properties
2) Edit Assembly Name
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
|
Hi
I want to access the items added in the list box or combo box on right click.
Example
List box contains:
ITEM(0)"First"
ITEM(1)"Second"
ITEM(2)"Third"
values have been populated and program is running now i "Right Click" on list box
what i want , the index number of the item on which mouse was Right clicked.
Thanx in anticipation
Riaz Ahmed
0300-2668545
Software Engineer
DCCTechnologies
riaz.ahmed@dcc.com.pk
|
|
|
|
|
On mouse up event of list box you can use IndexFromPoint method to get index of item which has been clicked. This index can be used to retrieve the actual listbox item, such as –
------------------------------------------
Private Sub ListBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ListBox1.MouseUp
Dim ItemName As String
If e.Button = Windows.Forms.MouseButtons.Right Then
ItemName = Me.ListBox1.Items.Item(Me.ListBox1.IndexFromPoint(e.X, e.Y)).ToString()
MessageBox.Show(ItemName)
End If
End Sub
-------------------------------------------
I hope this helps .
-Dave.
------------------------------------
http://www.componentone.com
------------------------------------
|
|
|
|
|
Hi All,
I want to check the menuitem visibilty. Menu items will be coming through recordset and will loop through the recordset. For each menuitem, I want to check the visibility like as follows.
frmMain.DefInstance.Controls(rstRef.Fields("cname")).Visible
but, abouve code is giving cast error.
if we hardcode the menu Item, its working fine. like as follows
frmMain.DefInstance.MenuItem1.Visible
But, if I want to check the menu item visibilty dynamically, how can I do?
Please let me know.
Thanks in Advance.
AR Reddy
|
|
|
|
|
for each mi as menuitem in frmmain.definstance.controls
if mi.visible = true then
'your code
end if
next
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Hi Jones,
Thanks a lot. Its working with little bit modifications. Thanks again.
AR Reddy
|
|
|
|
|
Hi Smithers-Jones,
With the given code is working fine but, its looping through all the menuitems that are in the form. But I want to checkfor few menus (that will come from recordset) only.
so from your given code, if I check mi.Name, Im not getting menu name.
like as follows,
Dim str as String = recset("cname")
for each mi as menuitem in frmmain.definstance.controls
if mi.Name == str
if mi.visible = true then
'your code
end if
next
So i am not able to check visibility property for few menu items.
How can I do this. Please let me know the solution if you get a chance to look into this.
Thanks in Advance,
AR Reddy
|
|
|
|
|
Not a problem, but was woundering how do you deside whether to use a function or a property, especially if they are private?
Comments, guidance ans in-sights if you please.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Generally, properties are used to represent the state of an object and have few if any side effects when set, and functions are used to get something that will require a lot of calculation. FxCop will also tell you that you should never return an array from a property, but I do not always agree (especially for databinding).
There are no hard and fast rules, but there are a few things I would consider when making the choice. (I'm sure a quick Google search would find plenty of other opinions)
1) Will you both get and set the value? (if yes, +1 for property)
2) Will you only get the value? (could go either way)
3) Will you only set the value? (if yes, I would always make this a function. Write-only properties do not make much sense to me)
4) Are you going to need to databind to this value? (if yes, you will probably be required to make this a property)
5) Would the Get/Set functions be simple? (if yes, +2 for property)
Simple is of course subjective, but generally it means something like this:
Get
Return _memberVar
End Get
Set (value as YourTypeHere)
If value = _memberVar Then Exit Property
_memberVar = value
OnPropertyNameChanged()
End Set
and the OnPropertyNameChanged would raise any events and perform any other state changes that come from setting the property (eg: when PropertyA to false, PropertyB must be 0).
|
|
|
|
|
A few more points to consider, IMHO:
-1- When an attribute is written, is the value likely to remain set indefinitely absent user intervention (things like controls may be changed by the user--that's their purpose).
-2- Will writing the attribute with the value it already contains have any effect (if so, use a method)
-3- Will writing this attribute have side-effects on other writable properties that are not subsets or supersets? There's nothing wrong with an object having properties for, e.g., X, Y, and position; changing position will update both X and Y; changing X or Y will update position. On the other hand, the 'length' property for a StringBuilder is ugly, since reducing the length has the side-effect of clearing some (or all) of the contents.
-4- Will reading this attribute have any side-effects other than possibly caching, or will it require access to a resource guarded by a mutex or synclock? If so, use a method.
-5- IMHO, some attributes should use a method for writing and a property for reading. For example, if I were designing the timer object, I would have included a TimeLeft property (read-only) and a SetTimeLeft method (possibly an AddTime method as well). The time remaining on a timer is apt to change as soon as it's written, so I don't like the idea of using a writable property for that; nonetheless, since the remaining time represents the object's logical state, a read property seems appropriate.
|
|
|
|
|
I use two criteria: Will it behave like a variable or like a function? If it will behave like a variable, do I need to do anything other that store/retrieve the data?
If all I need is some place to store data, I will write a private variable declaration; if I don't need to do the extra coding, I don't. If the value is static, I write a private constant declaration.
Private X As Integer
Private Const CaptionText As String = "Enter some data" If the value is dynamic and read-only, then I will write a private function.
Private Function FolderPath() As String
Return String.Format("{0}\{1}", PathTextbox.Text, FileTextbox.Text)
End Function
If I need to validate the data when it is retrieved or stored, do some other kind of processing or perform multiple operations with that value, that is when I will write a private property with at least a Get.
Private pStringList As List(Of String)
Private ReadOnly Property StringList() As List(Of String)
Get
If pStringList Is Nothing Then pStringList = New List(Of String)
Return pStringList
End Get
End Property
Private pMyHeight As Integer
Private Property MyHeight() As Integer
Get
Return pMyHeight
End Get
Set(ByVal value As Integer)
Dim H As Integer = MinHeight
If value > MaxHeight Then
H = MaxHeight
ElseIf value > MinHeight Then
H = value
End If
pMyHeight = H
ResizeMe()
End Set
End Property
|
|
|
|
|
Hi experts,
I have a typed dataset in my VB.Net project, where I use to add tables at
design time. Bydefault there are only four properties for the tables
like.. CaseSensitive, DisplayExpression, Locale and Name.
Here, my requirement is, I need three more user defined properties for as
many tables as I added at design time and in the same manner I need three
more user defined properties for the columns in the tables.
I hope, that my requirement is clear and I am awaiting for your help
Thanks a lot in advance to all who helps me
Ravi Shanker .L
|
|
|
|
|
Sounds like you want to derive a new class from the class that defines your tables now ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Thanks for the response
Its nothing like "derive a new class from the class that defines my
tables"
I just want to use the dataset designer to visually create and edit tables
and as well i need more properties at the same time. I can explain you a
bit clearly. Take a new VB.Net project, add new item to the project and
select 'Dataset'. There after, right click on the dataset area, select
Add -> DataTable from the popup menu, you are going to get a table with
no columns, right ?. Now, right click on the table and select properties
from the popup menu, a properties window is going to appear there are only
four properties bydefault right ?. But, i want some more properties there
Once again thanks for the response and I am awaiting for another response
Ravi Shanker .L
|
|
|
|
|
I think you'll probably find that Christian's answer is correct - there's no way to make properties 'magically' appear in the property window. You have to have a way of putting them there, and deriving another class with further public properties from the datatable class could be one way to go. Mind you, you might want to consider your design in general...
|
|
|
|
|
Thanks Paddy Body
I think I am a bit clear now, let me work on this as you both people
suggested me. Thanks once again for you both
Ravi Shanker .L
|
|
|
|
|
Hi, All
iam stuck on that how i reterive the particular record from data table object
Actullay i passed query result into dataset and create data table onject and fill the table with sql data adopter but now i have to extract particular record form data table object
PLease help me iam stuck on this .
|
|
|
|
|
The Rows property is a collection of all rows in the DataTable . You can use it to access any of the rows by index.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thnks for response
kindly write few lines of code that how i do that actully i wants to extract particular record from data table object and loop through the each row .
thanks for response
Rameez
|
|
|
|
|
Its just a simple for next loop, during which you look for the record you want.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Free hand, but you get the point:
For each oRow as DataRow in dsSales.Tables(0).Rows
If convert.toint32(oRow("CustomerID")) = 1234 then
'Do work here......
End if
Next
Cheers
|
|
|
|
|
You could use a DataView to filter your table and return the results.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hello,
How do i include the ADODB component to vb6? I've searched the available components though I can't find Microsoft ActiveX Data Objects 2.5 Library or 2.6 for that matter. Is there anyway around this? Many thanks for the help
Aim small, miss small
|
|
|
|
|
tatchung wrote: How do i include the ADODB component to vb6? I've searched the available components though I can't find Microsoft ActiveX Data Objects 2.5 Library or 2.6 for that matter. Is there anyway around this? Many thanks for the help
You need to install MS Data Access Components.
|
|
|
|