|
Andraw Tang wrote: When the form is loaded, I only want to fill in data for the default tabpage in tabcontrol, I don't want to fill in data for all tabpages by default until user first time select that tabpage, the logic is right?
Sounds good to me - if you'd load everything on startup, the user would have to wait until all seven pages are finished loading their data. This way, you're shortening the load-time considerably.
Andraw Tang wrote: will check the flag if data is filled in or not, if not, fill in data, set flag to true
Again, sounds good to me, since you'd only want to check whether it's loaded or not. The simplest approach is often the best.
As an alternative; I'm moving to a nullable DateTime , setting it to the DateTime of the last load-moment. A few triggers on the database that keep track of the DateTime of the last change, and it's possible to see if "something" might have changed in the database.
I are Troll
|
|
|
|
|
Eddy,
Thank you for your detailed explaination.
I agree with you, the simplest way is best, since there is no existing method in vb.net to check tabpage load, I'd better use flag to indicate it.
|
|
|
|
|
You're welcome
|
|
|
|
|
All:
I'd like to write a small boot program for my main app which needs a few file properties to load additional files.
What I'd like is for the boot program to get the same info as if you were to right-click on the file and select properties in Windows Explorer.
1) The filename in the properties textbox
2) The location (filepath)
3) File modified date
I can get the filepath from using the Environment.CurrentDirectory variables, but I haven't been able to figure out how to get the filename or date. Seems like it should be something simple.
What am I overlooking?
TIA for any help.
Norm
|
|
|
|
|
I believe what you are looking for can be found in fileInfo.
Dim fi As System.IO.FileInfo
fi = New System.IO.FileInfo("<put your executable path and file name here>")
fi.LastAccessTime
See if that work for you.
david
|
|
|
|
|
|
Try Application.ExecutablePath
|
|
|
|
|
thanks for your reply, but did you read my post???!!!
i tried it and it returnd path c:\windows\system32\msiexec.exe !!!!
M.Alizadeh
|
|
|
|
|
Are you running a MSI package of your application? Thats why it's showing c:\windows\system32\msiexec.exe
|
|
|
|
|
ok. then what should i do??? that means when i use a msi package always it return c:\windows\system32...???
i also test this way:
In the CustomActionData property of the Custom Action, type:
/DIR="[TARGETDIR]\"
Then in Installer class, add this code:
Dim path As String = Context.Parameters("DIR")
but when run setup.exe file it return a null string...
M.Alizadeh
|
|
|
|
|
Hi I use this code to get MAC address in network adapter, when I clone this MAC adress give me cloning MAC. I want to get real (fabric) MAC address.
Imports System.Management
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mc As New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
Dim MACAddress As String = [String].Empty
For Each mo As ManagementObject In moc
If MACAddress = [String].Empty Then
' only return MAC Address from first card
If CBool(mo("IPEnabled")) = True Then
MACAddress = mo("MacAddress").ToString()
End If
End If
mo.Dispose()
Next
MsgBox(MACAddress)
MACAddress = MACAddress.Replace(":", "")
' Then youc an set anything to MACAddress
MsgBox(MACAddress)
End Sub
End Class
|
|
|
|
|
ivo75 wrote: Hi I use this code to get MAC address in network adapter, when I clone this MAC adress give me cloning MAC. I want to get real (fabric) MAC address.
I'm sorry, but I really don't understand what you mean.
|
|
|
|
|
can you please give me an idea how can i implement live chat in my website? I want to know idea behind how to implement live chat Programtically. Am not looking for any gadgets or so, am looking for logic how do we in Vb.net ?
Any suggestion will be most appreciated.
Wayez
http://wayezquotes.blogspot.com
|
|
|
|
|
Syed Wayez Ahmed wrote: Any suggestion will be most appreciated.
Look at the CodeProject articles here[^], search Google for "live chat".
It's time for a new signature.
|
|
|
|
|
Thank You for your suggestion, I dnt know what is google before. You have given me a valuable suggestion.
|
|
|
|
|
Syed Wayez Ahmed wrote: Thank You for your suggestion, I dnt know what is google before. You have given me a valuable suggestion
There is no point your being sarcastic here.
It's ok that you knew about Google.
But did you do a search on it before posting this question here?
|
|
|
|
|
Did you check the CodeProject articles? Your question is one of the most common posted on this website: at least once every week. And always by people who appear too lazy to do some simple simple research for themselves.
It's time for a new signature.
|
|
|
|
|
Hi Richard!
Thnx for your replies. It seems u r angry now, being angry whn made to is quality of definately Male.
I did research and found many articles which point me to use activex which i dnt want to. and i want an ajax and saved chat can you suggest me for the same?
|
|
|
|
|
Syed Wayez Ahmed wrote: It seems u r angry now, being angry whn made to is quality of definately Male.
I apologise if I misunderstood your previous message. However your use of 'txtspk' rather than proper spelling makes it difficult to understand what you are saying.
Syed Wayez Ahmed wrote: and i want an ajax and saved chat can you suggest me for the same? Roll eyes
Same answer as before, look at the articles and search Google, this is such a common question there are many answers to be found. Select the one that best suits your knowledge and experience.
It's time for a new signature.
|
|
|
|
|
Hey Richard!
Thanx Again. Am on it(Looking for the articles in google), but if any article in your view is best, let me know ?
|
|
|
|
|
Hi, dear all,
I create a MDIContainer form (called form1) which has a TreeView on the left side, the treeview looks like and is designed at design mode:
+ Input Data
Primary Data
+ Object Data
Object 1
Object 2
Object 3
The Object number is 2 or 3, so by default I create 3 nodes, one for each object, my problems are:
1: Based on user selection about object number (2 or 3), I will decided remove (or disable or hide) Object 3 treenode, if user change the value to 3, I will add (or enable or show) this node. But I didn't find any information about disable treenode, can I disable treenode? If I use remove node, when I decide to add it back later, how can I make sure it is added at the same locatin in treeview?
2: if the user selection is stored in DB, then next time when he open the form, the object node number should be same as user selected object number, but from where I should initialize the treeview? Since the treeview is in form1 (MDI container), I thought I can do it at form1_Load() subroutine, but when I check the treenode count in it (using TreeView1.Nodes.Count),but I got value 1 instead of 6, why???
Thanks!
|
|
|
|
|
|
If you solved it yourself please post the solution so that others who have the same problem in the future can benefit from the solution as well.
|
|
|
|
|
Ok, maybe it's not an issue for most of you, but for new user like me, it may help.
When you get the node count using TreeView1.Nodes.count, it return the count of the root nodes directly under the TreeView, it doesn't include the node under subtree. If you want to get all node under TreeView, use TreeView1.GetNodeCount(True), here True means including all the nodes in subtree.
|
|
|
|
|
I have an urgent question about the datagridview and combobox column in VB2005
I am unable to show the first item in the award code field by default without selecting an item first. How can this be done?
For example CX should be shown in the blank area for the first 2 items, which shows up as blank. The 2nd issue is how can I take the data from my hidden field, which has an award code of either cd,cn,mr, etc, which is brought back in the dataset below and is on the grid but the column is just hidden. I actually need this data shown as the default in the “blank space” of the combobox. I am at a loss. So basically when I load the grid I need the award code for a specific row placed into the combo box as if it were selected for that specific row by default. So row 1 would show the following:
Row 1 would show Transfer =blank Rfa number CX08-004 Award Code=CD
Row 2 would show Transfer =blank Rfa number CX08-003 Award Code=RP
etc
etc
Below code is what I use to bind the datasource to the combo box
With grdBatchBudgetProjection ‘Dataviewgrid
With chk ‘CheckboxColumn
.DataPropertyName = "AwardCD"
.HeaderText = "Award Code"
.Width = 100
' Bind Column
.DataSource = ds3.Tables(0)
.ValueMember = "AwardID" ‘also tried AwardCD here
.DisplayMember = "AwardCD"
.DisplayStyle = DataGridViewComboBoxDisplayStyle.ComboBox
'dd or cbo, doesn't really matter for this field.
End With
.Columns.Add(chk)
End With
-----------------
I also tried the below code with no success. i just cannot see what I am doing incorrectly.
<pre>'Kludge loop to have combo box index= value returned from sql
'For iRowCount = 0 To ds2.Tables(0).Rows.Count - 1
Dim j As Integer = 0
For Each row As DataGridViewRow In grdBatchBudgetProjection.Rows
'' Dim Cell As DataGridViewComboBoxCell = DirectCast(grdBatchBudgetProjection.Item(5,j),
DataGridViewComboBoxCell)
Dim cell As DataGridViewComboBoxCell = DirectCast(grdBatchBudgetProjection.Item(5, j),
DataGridViewComboBoxCell)
cell.Value = ds2.Tables(0).Rows(j)(4).ToString
'Debug.Print(ds2.Tables(0).Rows(j)("AwardCD").ToString)
'grdBatchBudgetProjection.Rows(j).Cells(5).Value = ds2.Tables(0).Rows(j)
("AwardCD").ToString
j = j + 1
Next</pre>
Thank You for your time
|
|
|
|