|
Hi all, im a novice programmer. I was wondering how I could get a Folder Treeview with checkboxes (VB6). More specifically, I want to feed an array of directories (paths) to a treeview with checkboxes. These directories would be the highest level in the treeview (ie when collapsed, the only items or nodes would be the list from the array of directories).
The purpose of this is so that I can exclude or include (with checkboxes) subfolders for the purpose of copying files en-mass (a lot a time).
Ive seen examples of this from http://btmtz.mvps.org/treeview/ but as I am a novice programmer, I have difficulty in implementing... any help would be appreciated.
|
|
|
|
|
I need help i am trying to creat a program in VB.net for a pda.
i already have the database created using the quary analizer.
but i can not get the connection to work.
Public Sub conn()
Dim conn As New SqlCeConnection
conn.ConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0; Data Source=\My Documents\abook.sdf;"
end sub
but i keep getting exceptions
i have searched threw several examples but they all start out by creating the database or using XML.
all i want is to retrieve data and manipulate it.
please some one explane what i am doing wrong, and a good example of what i need to do.
|
|
|
|
|
I have a scanned image which has two small circles in it. One is black colored another is white , in a picture box. I want to read the specific rgb of the two circles and represent the name black and white in two labels in a form.
Pls help me
|
|
|
|
|
Im a beginner in VB.net. Im was about to create a text log file to record my application activity such as the user update or delete something then such activity will be recorded in text file. I have this code from code project last time:
Private Shared Sub WriteToAppLog( _<br />
ByVal message As String _<br />
, ByVal messageType As EventLogEntryType _<br />
)<br />
Dim elLog As System.Diagnostics.EventLog<br />
Try<br />
elLog = New System.Diagnostics.EventLog( _<br />
"Application" _<br />
, Environment.MachineName _<br />
, Application.ProductName _<br />
)<br />
elLog.WriteEntry(message, messageType)<br />
Catch ex As Exception<br />
'Your error handling here<br />
End Try<br />
End Sub
But im not really understand how to implement it and where i can check the log file from above code? Does it appear to be .txt file? and does above code have to be placed in every form in my vb.net? If u have any other code than above, feel free to tell me.
Please help me, this is my last step of my project.
Thanks.
|
|
|
|
|
hello world,,,
can any one help me plis.. with this...
1- how can send messages anom.,. the code pls,,, i try with other programs,, y want the code,,, simple as that
2- how capture the incoming message,,, in a label or a text box,,,,
thanks a lot
jam
|
|
|
|
|
Goal: I need to use Windows Groups to determine access to certain
controls on an intranet web app.
Specs:
1. I can only use Windows Authentication.
2. IIS6.
What I have done so far:
1. I have an application already in use that uses Windows
Authentication.
2. I added two new groups each with users to my local machine.
3. I added this code in the web.Config:
<identity impersonate="true">
<authentication mode="Windows">
<authorization>
<allow roles="WORK\Administrators">
<allow roles="LOCAL\Administrators">
<allow roles="LOCAL\Basic">
<allow roles="LOCAL\Master">
<deny users="*">
4. I have this code in the code-behind of my start page:
Dim authUserName As String
authUserName = User.Identity.Name.ToUpper.Trim
Session("Username") = authUserName
If Principal.WindowsIdentity.GetCurrent.IsAuthenticated
Then
Server.Transfer("main.aspx")
End If
Questions:
1. How can I determine the Group name of the user when they log in?
2. How can I set up my local machine to test my program?
|
|
|
|
|
Hello i am currently executeing a program though VB . Net with the following code
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("c:\file.exe")
startInfo.CreateNoWindow = True
startInfo.WindowStyle = ProcessWindowStyle.Minimized
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
Is there a way i can make it halt the script untill the process has finished installing etc then it carrys on.
Also is it possible to create progress bars for files i am executing with the following code above?
Thanks
Oliver
|
|
|
|
|
phraser wrote:
Is there a way i can make it halt the script untill the process has finished installing etc then it carrys on.
You're already doing it.
pStart.Start().WaitForExit()
If your code doesn't block and wait for the process to exit, it means that the process you started already has exited. I take it you're launching some kind of shell .EXE and it is doing a Windows Installer installation (MSI file)? This will cause you great difficulty because the process you launch quits before the MSI is done installing. Since you can only have one MSI install going at a time, you can write a function to mointor a Process list for "msiexec". When all of the "msiexec" processes have finished, you can be reasonably sure that the installation is complete.
phraser wrote:
Also is it possible to create progress bars for files i am executing with the following code above?
No. Since the processes you're launching don't report back any kind of progress, you can't make a 0% to 100% ProgressBar. You can, however, make a non-progress ProgressBar. Confused? This is simply a bar that scrolls endlessly, indicating something is going on. Like the White/Blue/Black bar on the Windows 2000 title screen that scrolls acrossed the windth of the screen when 2000 boots. XP has a little green box scroller during installation and another scroller when it boots on its title screen.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ah sorry i am still learning vb abit
Anyway when the .exe file is executed from the vb program, it likes to hang abit till it is closed.
Is there a way around this
And about the progress bar thats what im after an exact copy of like XP's boot one, any ideas how to make one?
Thanks
Oli
|
|
|
|
|
What do you mean "hang a bit till it is closed"? Does it do this only when launched from VB or does it always do this? If it always does it, the exe is running some kind of final termination code. Running it from VB should make no difference...
As far as doing a progress bar that loops a period or whatever, you will have to do it on a different thread because the thread that launches the exe will be blocked until the the Wait function becomes signalled.
Exactly how you go about this just depends on your application design. You could create a new thread for the "progress" loop. But if your application already showing some kind of UI, then you should run the loop there and create the new thread to run the EXE instead.
Either way, you will have to have two threads, no way around it.
Robert
|
|
|
|
|
phraser wrote:
And about the progress bar thats what im after an exact copy of like XP's boot one, any ideas how to make one?
Lucky for you -> Building a Progress Bar that Doesn't Progress[^] on MSDN.
phraser wrote:
Anyway when the .exe file is executed from the vb program, it likes to hang abit till it is closed.
I have no idea what you mean by this and what the problem is with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The problem with the program is that when the exe is executed ( calc.exe ) the VB program freezes ( dosent respond ) till the calc.exe is closed.
This is a problem because i have a label that is ment to show as the file runs but as the program freezes waiting for this other program to close it dosent not show.
Thanks
Oli
|
|
|
|
|
phraser wrote:
when the exe is executed ( calc.exe ) the VB program freezes ( dosent respond ) till the calc.exe is closed.
That's what .WaitForExit() is supposed to do!
You never mentioned anything about updating a label. Set the label Text how you want, call Application.DoEvents() , then launch your external app, like calc. Once you hit the .WaitForExit() call, that thread is blocked from executing until the external app closes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It still effects it even if the updated label is ment to update before the process is ran?
*EDIT* It worked fine but i still have one problem i have my progress bar working fine now and i enable it before i put Application.DoEvents() yet it does not want to like progress along if u know what i mean lol just it stops till i exit the program where the thread continues.
Any command to process this type?
Thanks
Oli
|
|
|
|
|
If your progress bar is written correctly (multi-threaded), then it should update while another part of the form code is blocked.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
The code i use is as follows
ProgressBar1.Visible = True
ProgressBar1.Value = 0
Timer1.Enabled = True
Application.DoEvents()
Dim startInfo As System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
startInfo = New System.Diagnostics.ProcessStartInfo("calc.exe")
pStart.StartInfo = startInfo
pStart.Start()
pStart.WaitForExit()
pStart.Close()
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar1.Value = ProgressBar1.Value + 1
If ProgressBar1.Value >= 100 Then _
ProgressBar1.Value = 0
Return
End Sub
How would i multi-thread the process?
Thanks
Oli
|
|
|
|
|
You can't do it using a form-based timer.
Read the article that I already posted the link to. Everything is in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
*EDIT*
Never mind fixed it
Thanks
Oli
|
|
|
|
|
I am new to VB.net and have a form with a number keypad on it using buttons. I need to adjust the buttons when the user resizes the form. Can someone tell me how to do this?
|
|
|
|
|
|
Hi...
I am used to VBA so bear with me.
I need to identify if a value from a Stored Procedure falls within a parameter using the "between" syntax. For example, show me all of the records that fall between February 1, 2005 and February 28, 2005.
My problem is one of syntax. I know how to have the Stored Procedure filter the records using a parameter. eg:
Me.daCostingRecSearchByVendor.SelectCommand.Parameters("@TravelDate").Value = CDate(Me.dtpCostingStarting.Value).Date
Not a problem... displays the values I want for a Date I have selected using a DateTimePicker on my form. Here is the twist. I have two DateTimePickers on this form and I want to have the parameter (@TravelDate) select values which fall between the them.
How do I adjust the syntax? I have tried various methods including <> or 'GreaterThanOrEqualTo'... nothing has worked for me so far.
Any advice would be helpful.
Thanks in advance...
Pat
|
|
|
|
|
You need two parameters One for the starting date of the interval, the other for the ending date
Select [mydate],[a],[b],[c],..., from [MyTable] where [mydate] >= ? and [mydate] <= ?
then
<br />
SelectCommand.Parameters("@startdate") = CDate(dtpCostingStarting.Value).Date<br />
SelectCommand.Parameters("@enddate") = CDate(dtpCostingEnding.Value).Date<br />
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
The opposite of the religious fanatic is not the fanatical atheist but the gentle cynic who cares not whether there is a god or not.
Eric Hoffer
|
|
|
|
|
Could some one please help me with the understanding how to pass the values to a drop downlist?
What i am tring to do is pass a parameter (@Likethis) from a selected item in a list box or a dropdown to a dropdown or a list box. I am assuming the i will have to attach the @Parameter to the selected item some how and in turn this will set off a stored procedured that will populate the dropdown,..
Please Help,
Erik...
=================I wanted to come back and add my code...
This is what i have been able to come up with.
Please let me know if i am on the right track
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
'
Dim cnn As New SqlConnection("data source =desktop; initial catalog= northwind;trusted_connection=yes")
cnn.Open()
'
'You can modify it to
Dim da As New SqlDataAdapter("select * from customers", cnn)
Dim ds As New DataSet
da.Fill(ds, "Test")
'
ListBox1.DataSource = ds.Tables("Test")
ListBox1.DataValueField = "ContactName"
ListBox1.DataTextField = "ContactName"
ListBox1.DataBind()
End Sub
Private Sub dl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
'
If ListBox1.SelectedValue = "Hanna Moos" Then
ddl.DataSource = GetStuffForDDL("PrAmNaMe")
Else
ddl.Visible = False
End If
End Sub
Function GetStuffForDDL(ByVal PrAmNaMe As String) As SqlDataReader
'
'Begin The Madness
'
Dim cnn As New SqlConnection("Data Source= DeskTop; Initial Catalog=Northwind; Trusted_Connection=Yes")
Dim Mycmd As New SqlCommand("GettingParamForDDL", cnn)
'
'If ListBox1.SelectedValue = "Hanna Moos" Then
'End If
Dim PARMHannaMoos As String = "Hanna Moos"
'
Dim PramHannaMoos As New SqlParameter("@PARMHannaMoos", SqlDbType.VarChar, 50)
PramHannaMoos.Value = PARMHannaMoos
Mycmd.Parameters.Add(PramHannaMoos)
'
Mycmd.CommandType = CommandType.StoredProcedure
'
cnn.Open()
Dim Result As SqlDataReader = Mycmd.ExecuteReader(CommandBehavior.CloseConnection)
Return Result
cnn.Close()
Result.Close()
'
'End The Madness
'
End Function
End Class
|
|
|
|
|
I have a aplication using VB.net and CSGL for OpenGl. It works perfect on my computer, but when I try to install it on a computer where .Net is not installed the main window drawing does not work well( a grid drawn with OpenGL that is not displayed corectly, also gif on the main form are not displayed on some computers). On some computers it work on some not. All tested computers have the .NEt framework installed, via the MS updated. Installing .NEt via MS site does not solve the problem. ANy ideeas ?
|
|
|
|
|
pharao92 wrote:
but when I try to install it on a computer where .Net is not installed
The same version of the .NET Framework runtime MUST be installed otherwise your app wouldn't run at all.
Do these machines have an updated OpenGL library installed on them? Preferrably the same version you compiled against.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|