|
Ciao a tutti, ho un problemino e spero che qualcuno possa aiutarmi.
in vb.net dovrei creare un form di opzioni simile a quello che si vede in word 2007, ossia a sinistra una lista di categorie (che ho fatto utilizzando un controllo treeview) e a destra dovranno apparire i vari settaggi collegati alle categorie. Il punto è che non vorrei utilizzare un Tabcontrol ma vorrei che la pagina si aggiornasse automaticamente con i controlli a seconda della categoria scelta.
spero di essere stato chiaro.
Grazie a tutti.
|
|
|
|
|
post your problem in English language. so everyone can understand and you will get correct answer.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
hi,
i'm want to know is that posible if i can use variable instead of listbox.
for example if i have label1, i can use variable by using 'dim lbl as string',
is there posible if i use the same method for substitute listbox control?
i dont know what to type to google it..
plz..
|
|
|
|
|
dim Str as list(of string)
Str.add("Hello")
etc...
|
|
|
|
|
What are you trying to achieve?
A variable is memory storage and a ListBox is a User Interface control with properties. You can dim a control like a variable e.g. Dim myListBox As ListBox or Dim Label1 as Label
A ListBox is affectively a control for displaying collections (including DataRows) or arrays.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
explore you question in more detail.
if you want to add a item to list box for each label, then you can use Array
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
i am working in VB6, a window base project
use a adodc control
i give
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sms.mdb;Persist Security Info=False"
on form load
and in properties window i leave blank the connection string
but its not working
Error: [microsoft][odbc driver manager]Data source name not found and no default drive specified
and if i give any connectionstring in the properties of adodc control then it is hardcode i have to avoid that
Please help me
battan20@gmail.com
|
|
|
|
|
i am using MS access file in that project
|
|
|
|
|
how about using adodb instead of adodc?
just a suggestion
i have exacly no clue about your problem ![Big Grin | :-D](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_biggrin.gif)
|
|
|
|
|
Amit Battan Ror wrote: i am working in VB6
Sorry to hear, since VB6 has been dead for quite some time now...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi,
in have a public function, let say
public function Merge(.........) as image
(some code)
end function
how can i call this function in my button click event?
i never use this method before, after google it i just find call function
from other developer software like javascript, c and c#
plz help me..
|
|
|
|
|
How do you call other functions at the moment?
|
|
|
|
|
I encountered a project a few years back written by some indian guys in vb (they "apparently" had some c# background). everything was written as a function, no "subs" anywhere whatsoever.. All these functions returned nothing.. Their idea of code reuse was to bung everything into one huge global class and define it in every single page they wrote, even if no functions were used from that class (this was their idea of code reuse) . It was a joke.
On thinking back, this entire project qualifies as a coding horror!
|
|
|
|
|
since your function(as you specified in sample code) return image so suppose your button name is "Save". so on click event of this button use following code
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click<br />
dim ob as image<br />
ob=merge(byval anyVaribale as object)' you can put anything in place of object datatype<br />
<br />
End Sub
hope this helps
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
My app displays the following two error messages. I have an unhandled exception sub to catch these, but its displayed anyways. When run locally (both as build or debug), I see no error messages. Am I missing some sort of .Net configuration?
1st[^]
This is a result of running:
Try
Dim HowManyCities As Integer = SQLCount("SELECT Count(LCF_Info_Market) FROM " + cboMarket.SelectedItem.ToString, Database)
Dim Cities(HowManyCities - 1, 1) As String
Dim i As Integer
Cities = GetCities("SELECT LCF_Info_Market, LCF_Info_Code FROM " + cboMarket.SelectedItem.ToString, Database, HowManyCities)
For i = 0 To Cities.GetUpperBound(0)
cboCities.Items.Add(Cities(i, 0))
Next
PopulateCodes()
Catch e As Exception
MsgBox(e.ToString)
End Try
2nd[^]
This error is simply from:
Application.Exit()
![D'Oh! | :doh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_doh.gif)
|
|
|
|
|
I need to be able to validate the list View. I need to know how to check and see if the user did not check a box.
|
|
|
|
|
Just have a boolean value set to true or false based on if a box has been checked. Set the boolean value in an event procedure that is fired when the box is checked. That is my quick stab at it, without any detailed code or description of what you are trying to do.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
This is my validation if statement. When I debug I get an error. Can you give me an example of how to check for a checked item using the boolean value?
If lvwRent.CheckedItems(0).Text Is "" Then
|
|
|
|
|
why would you need Text? just look at the count of the items in lvwRent.CheckedItems
|
|
|
|
|
Thanks, Luc, you saved me from some code typing
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
When code does not feel good, I'd prefer to remove some, rather than add some.
|
|
|
|
|
I agree
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
i hav window service app. when i start the method call by onstart method fire only once
|
|
|
|
|
The OnStart[^] method only fires once, so any calls in it will also only be fired once. Start a thread in OnStart if you want something to loop. (Don't do a loop in OnStart as the service won't finish starting until the loop completes.)
|
|
|
|
|
i did not do a loop . already have a loop please look at the code
Public Class AuthorLogService
Public diamondEmail, Hostname, DomainName, diamondEmailBox, diamondUserName, diamondPassword, Protocol, ftpUser, diamondEmail1, diamondEmail2, diamondEmail3, ftpLogDirectory As String
Public UserName, Password, emailName, pfcAccount, pfaAccount, pfaName, ccemail, bccmail, logFullPath, dbFullPath As String
Public timeinterval As Int32 = 12000
Public connectionstring As String
Public con As SqlConnection
Public command As SqlCommand
Protected Overrides Sub OnStart(ByVal args() As String)
' Add code here to start your service. This method should set things
' in motion so your service can do its work.
Const iTIME_INTERVAL As Integer = 120000 ' 2 *60 seconds.
Dim oTimer As System.Threading.Timer
'Dim con As New System.Data.SqlClient.SqlConnection("server=PRGLAP11;database = Diamonddb ;uid=sa;pwd=eb")
connectionstring = My.Settings.connectionstring
con = New SqlConnection(connectionstring)
'Dim command As SqlCommand = New SqlCommand("", con)
Command = New SqlCommand("", con)
Command.CommandType = CommandType.StoredProcedure
command.CommandText = "getHost"
Dim adp As SqlDataAdapter = New SqlDataAdapter(command)
Dim dt As New DataTable
adp.Fill(dt)
Dim dtr As DataTableReader = dt.CreateDataReader
While dtr.Read
Hostname = dtr.GetString(1)
DomainName = dtr.GetString(2)
diamondEmail = dtr.GetString(3)
diamondUserName = dtr.GetString(4)
Protocol = dtr.GetString(5)
diamondPassword = dtr.GetString(6)
ftpLogDirectory = dtr.GetString(7) & "\" & "ex" & Format(Today.Date, "yyMMdd") & ".log"
'timeinterval = dtr.GetInt32(8) * 6000
'System.IO.File.AppendAllText("C:\test2.txt", Hostname)
'System.IO.File.AppendAllText("C:\test2.txt", DomainName)
'System.IO.File.AppendAllText("C:\test2.txt", diamondEmailBox)
'File.AppendAllText("c:\test3.txt", "these are ")
End While
dtr.Close()
Dim command1 As SqlCommand = New SqlCommand("", con)
command1.CommandType = CommandType.StoredProcedure
command1.CommandText = "getdiamondmails"
Dim adp1 As New SqlDataAdapter(command1)
Dim dt1 As New DataTable
adp1.Fill(dt1)
Dim dtr1 As DataTableReader = dt1.CreateDataReader
While dtr1.Read
diamondEmail1 = dtr1.GetString(1)
diamondEmail2 = dtr1.GetString(2)
diamondEmail3 = dtr1.GetString(3)
'System.IO.File.AppendAllText("C:\test2.txt", diamondEmail1)
'System.IO.File.AppendAllText("C:\test2.txt", diamondEmail2)
'System.IO.File.AppendAllText("C:\test2.txt", diamondEmail3)
End While
dtr1.Close()
System.IO.File.AppendAllText("C:\henry.txt", "AuthorLogService has been started at " & Now.ToString)
Dim tDelegate As Threading.TimerCallback = AddressOf EventAction
oTimer = New System.Threading.Timer(tDelegate, Me, 0, iTIME_INTERVAL)
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your service.
End Sub
'this eventaction is fired once
Public Sub EventAction(ByVal sender As Object)
'Dim s1, s2, s3 As String
System.IO.File.AppendAllText("C:\test3.txt", "AuthorLogService fires EventAction at " & Now.ToString())
System.IO.File.AppendAllText("C:\test2.txt", Protocol)
System.IO.File.AppendAllText("C:\test2.txt", timeinterval)
System.IO.File.AppendAllText("C:\test2.txt", ftpLogDirectory)
End Sub
End Class
|
|
|
|