|
can any one tell me how can i make a proceduers in vb2005
and how can i call it from any other place
thanks
|
|
|
|
|
Private Sub MyProcedure()
<BODY>
End Sub
Now call this MyProcedure() from any event inside the form:
Private Sub Form_Load()
Call MyProcedure
End Sub
If you want this Procedure to be accessible in the whole project, you will have to declare it as Public.
Hope this helps....
The name is Sandeep
|
|
|
|
|
thanks u very much
it helped me a lot
|
|
|
|
|
hi,
I want to display report on VSPrinter component of Vb6.0.
Pls send me the code if u r having???
GIRISH
|
|
|
|
|
There's no such object as VSPrinter that comes with VB6. If you're using a third party control, you'd have to go to the manufacturers site for support on it.
|
|
|
|
|
I want some Demos and tutorials of Crystal reports in vb 6.0.
Pls send me the links for the same.
Thanks !!!
GIRISH
|
|
|
|
|
If you have installed Crystal Report in your machine, then no doubt you will get the Help with it.
The name is Sandeep
|
|
|
|
|
Hey guys, I'm having an issue with the windows CheckedListBox control. I set it to only be able to select one row at a time, however it still allows multiple checked rows, just not multiple highlighted rows, anyone know of a way to be able to only check a single row?
Thanks for any help,
Pablo
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Polymorpher wrote: however it still allows multiple checked rows
This is the correct behaviour, since selected items are the highlighted, not the checked ones. IMHO you have to explicitely uncheck the previuos checked item(s) (the CheckedListBox.CheckedIndices will be handy for the purpose) to obtain the aimed result.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I want to convert VB.Net .
Vb 6.0 code
m_strSql = "Select Top 0 From TableName"
aCmd.CommandText = m_strSql
aRec = aCmd.Execute
Select Case aRec.Fields(0).Type
Case ADODB.DataTypeEnum.adVarChar
MsgBox "String"
Case ADODB.DataTypeEnum.adSmallInt
MsgBox "Integer"
end select
Dim dt As DataTable = New DataTable
Using reader As IDataReader = db.ExecuteReader(m_strSql)
dt.Load(reader)
End Using
Select Case dt.Columns(0).DataType
?? case system.char ??
MsgBox "String"
end select
system.char is why can't be use as an expression.how can i know dataType ???
thanks all.
|
|
|
|
|
There may be an easier way but you can convert the type name to a string and compare using that
eg
Select Case typeof(myobject).ToString
Case GetType(String).ToString
Return "This is a string"
Case GetType(Integer).ToString
Return "This is a number"
Case else
return "Unhandled type: " & typeof(myobject).tostring
End Select
What that is doing is getting the string definition of the 'myobject' and then comparing that to the string values of the types of integer, string, etc
There is probably a better way of doing this but it should work OK.
|
|
|
|
|
Hey all:
I have written a code that will export my data from Datagrids to Excel. It is taking sometime to write the data in excel file. I thought it would be better if I could provide some visual feed back to user like in progress bar or any other when my application writes data in Excel.
Can any body help me how to set the inteval and how can know that excel application is opened from the code?
Others type of suggestions for achieving my tasks is highly appreciated.
|
|
|
|
|
Hi,
Don't know if this will help, But I have used this a few times in excel to show a progress in the status bar...
Sub StatusProgress()
'
' Progress Application Statusbar
'
Dim intIndex As Integer
Dim sngPercent As Single
Dim intMax As Integer
intMax = 100
For intIndex = 1 To intMax
sngPercent = intIndex / intMax
ProgressStyle sngPercent
DoEvents
'------------------------
' Your code would go here
'------------------------
Sleep 100
Next
Application.StatusBar = False
End Sub
Function ProgressStyle(Percent As Single)
' Progress Style
' Application Status bar
' Pulsing
'
Dim strTemp As String
Dim intIndex As Integer
Dim intLen As Integer
intLen = 21
intIndex = Int((Percent * 100) Mod intLen)
strTemp = String(intLen, txtPg7a.Text)
If intIndex > 0 Then
Mid(strTemp, intIndex, 1) = txtPg7p.Text
End If
Application.StatusBar = "Processing " & strTemp
End Function
Cheers,
Stefan.
All answers have a question? All code has an end.
|
|
|
|
|
Opps,
Adjustments to above code...
Replace 'txtPg7a.Text' with "o" and replace 'txtPg7p.Text' with "•"
Sorry..
Cheers,
Stefan.
All answers have a question? All code has an end.
|
|
|
|
|
Hey I repalced whatever you have told me but I still get some compile errror?
What exactly o and . are doing?
and it also gave me some erros on other parts of code. Is the code written in VB.NET?
|
|
|
|
|
Hey,
Sorry forgot to declare 'Sleep'
Place this at the top of your module
Option Explicit<br />
<br />
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long )
The "o" and "." are use to show a progress in the status bar, the "." runs along the "o" to give you the progress.
Hope this helps.
Cheers.
Was written in Visual basic
"All answers have a question? All code has an end."
|
|
|
|
|
Hi,
Is it possible to have multiple thumbs along a slider control, if so can anyone direct me as to where I can find informantion on how to do this..
Thanks in advance!
Stefan.
All answers have a question? All code has an end.
|
|
|
|
|
No, using the standard TrackBar control, it isn't. You'd have to use a 3rd party control that offers this functionality, or write your own version, or use two trackbars coordinated to show a minimum and maximum range.
|
|
|
|
|
Thanks much appreciated!
"All answers have a question? All code has an end."
|
|
|
|
|
HELP!!!
Hate to trouble you all, but I am a student and have been trying to figure out how to understand arrays. My current delima is that I need to create a program which will give the user the ability to input 10 different numbers, list them in a single box, and then report back which number is the highest and which is the lowest after inputting. I intend to use a button to activate the event. I realize this will require an upper bound of 10 (9), but for the life of me I cannot figure out how to create the user input. Any ideas?
Thanks!
Bruce
"Thank you masked man"
|
|
|
|
|
simple algorithm
declare array
dim myarray(1 to 10) as integer
...
for i = 0 to 9
read num from user
add num to listbox
myarray(i+1)=num 'remember indices in VB start at 1. list boxes are zero indexed.
loop
now that they're in an array and visibly in listbox you can start checking them
smallest = myarray(1) 'assume smallest is first one
for i = 2 to 10 'remember this is the array not listbox
if smallest > myarray(i) then 'if number is less that previous num then
smallest = myarray(i) 'assign smallest to number
loop
...bla bla bla
...do the same with the biggest...
-- modified at 22:05 Sunday 1st July, 2007
|
|
|
|
|
You could do it simply by showing a textbox which allows comma seperated values and then validate the input and then call string.split, for example
Dim myString As String = "1,2,3,4,5,6,7,8,9,10" 'Would come from textbox
'Split the string on commas
Dim items() As String = myString.Split(","c)
'Ensure we have the correct amount of values
If items.Length <> 10 Then
Throw New Exception("Incorrect number of values")
End If
'Now do whatever you wanted with these values.
|
|
|
|
|
Hi,
I am in a spot on concern because I am stuck and do not know what to. All my processing happens on one page.
My page has a file upload control, with an upload button. When the upload button is clicked, it loads the file's contents into a dataset. It loops through the column names of the dataset and populates it to a textbox dynamically. Here the values can me altered and mapped to a database field. When I click the Import button, all the textboxes created are all gone. I do not know how to keep the textboxes there once the Import button is clicked because I need the values in the textbox.
Please can some one help me.
Regards
ma se
|
|
|
|
|
I take it you're using a control array of text boxes.
Perhaps they're not missing. Do something like this to show your textboxes
i=1 'set in form load
...button click
load text1(i) 'assuming you've set index to zero of the first textbox
text1(i).top = text1(i - 1).top + text1(i - 1).height 'set new box pos just below previous textbox
text1(i).visible = true 'show it
...
i=i+1'get ready for next click
-- modified at 21:43 Sunday 1st July, 2007
|
|
|
|
|
Please check:
http://www.brendanvogt.com/SD_ImportExport3.jpg
When I click the Perform Import button then it all disappears. The drop down were created dynamically when I did a file upload.
PS: It wasn't textboxes, but drop downs.
ma se
|
|
|
|