|
Thanks Guys.
in fact i found it, all i have to do is:
declaring a new event to my user control
Public Event Selected_Index_Changed()
and this
Public Sub My_ComboBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles My_ComboBox.SelectedIndexChanged
Index = Me.My_ComboBox.SelectedIndex
RaiseEvent Selected_Index_Changed()
End Sub
so when the combo box change index the user control raiseevent Selected_Index_Changed
this way i can use it in the original form
sorry if my post was to long just wanted to share my ideas and make the code much more better
thanks again.
waelhawari
|
|
|
|
|
Hi gents,
Please provide me a real time example for Delegate.
Regards
Azeem
|
|
|
|
|
|
How to remove white space from middle of string
Iam Using string builder and iam getting the text in string builder-
HI Welcome to India
I want to remove spaces in between and the result shouldbe
HIWelcometoIndia
pls any one help
|
|
|
|
|
Dim asdf As New System.Text.StringBuilder
asdf.AppendLine("this is a test")
asdf.Replace(" ", String.Empty)
MsgBox(asdf.ToString)
|
|
|
|
|
Hi all
I have already posted my article for access permission.
But i would like to know how to give password and username to folder which is created at runtime?
is it possible through coding in vb?
If yes pls help me
Thnaks
monika
|
|
|
|
|
You want to password protect a Windows folder?
|
|
|
|
|
For reasons too boring to go into, I need to make a set of textboxes open depending on the user input.
for example, I have TextBox1, TextBox2, TextBox3 etc up to 7.
I have a combobox that is populated 1 to 7
User selects 6 for example, I want textboxes 1-6 to become visible.
I am trying something like this...
For i = 1 to intNumOfBoxes
TextBox(a).Visible = True
Next
Of course it isn't working!
I tried TextBox & intNumOfBoxes, still no joy.
I know it is late and I am being dim, but any suggestions?
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
Declare a control TextBox using the contactenated string as the name. I think this works.
Dim oTB as new textbox("textboxname")
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: Dim oTB as new textbox("textboxname")
Doesnt seem to work.
It say "Too many Arguments to Public Sub New()"
However...
I tried this
Dim oTB As New TextBox
For a = 1 To INumOfBox2
oTB.Name = "TextBox"
oTB.Name = oTB.Name & Str(a)
oTB.Visible = True
Next
It accepts it, but doesn't make visible the Text Boxes
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
I think you will need to use reflections to get at the textbox (or a case statement which is simpler but a kludge)
dim oTB as textbox
Select Case cbo.selectedvalue
case 1....
otb = txtBox1
Dalek Dave wrote: Dim oTB As New TextBox
This instantiates as new textbox which you then assign a name to and discard.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thanks, I will try that in the morning though, 3.21am and brain starting to fry.
I can see a way of doing it that is long winded, so I hope that your method works!
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
Well, it should be morning and here is a work around that made me chuckle. It may not be a good one bu it works.
Create a groupbox/panel to hold your combo and 7 text boxes.
Make sure the tab order is sequential within the container - critical
in the on change event of the combo put the following (i had it in a button event for testing)
Dim oCtrl As Control = Me.cboList
Dim iLimit As Int16
iLimit = CInt(cboList.Text)
For i = 1 To iLimit
oCtrl = Me.GetNextControl(oCtrl, True)
Next
If Not IsNothing(oCtrl) Then
oCtrl.Text = iLimit
End If
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If the textboxes are called TextBox1, Textbox2, etc. you may be able to do something like:
Dim Const TextBoxes() as TextBox = _
{TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, TextBox7} and then do TextBoxes(a).Visible=True
|
|
|
|
|
Thanks, I knew I was on the right track, but I couldn't work out the method!
That works perfectly well, and is exactly what I need!
I was trying to treat the method TEXTBOX as an array, obviously a no no.
Cheers.
Now, onto my next problem...soon
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
You can create the textboxes as an array control and change the indexes according to your needs, and use this code to make them visible:
for i=1 to numberselected
textbox(i).visible = trun
next i
|
|
|
|
|
Can some1 remind me how I pass a variable from one procedure to another in excel visual basic
|
|
|
|
|
without seeing the code or knowing the context, it is difficult to give a good answer, but I would suggest that you throw out the variable to a FUNCTION.
Function FunctionName(Prefix As String) As String
Do something here to generate/define/call the variable
End Function
You can call the fuction from the other module
Hope that helps
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
Hi ,
Does any body know what %%Email%% means in this particular code.
Dim msg As New MailMessage
msg.To.Add("%%Email%%")
msg.Subject = GetSubject(emailAlertTypeID)
msg.PlainMessage.Body = TemplateBody
msg.From.Name = EmailFromName
msg.From.EMail = EmailFromEmail
msg.ReplyTo.EMail = EmailReplyToEmail
msg.ReturnPath.EMail = EmailReturnPathEmail
Because, it is not taking emails from stored procedure And how can I declare to get emails.
|
|
|
|
|
It doesn't mean anything at all.
Yous should substitute the string with a string containing the email address that you want to use.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Is it possible to do the following and if so how?
1) assign variable a range ie: Range = "A1"
2) perform calculations with the variable
ie: NewRange = Range + 1 answer = B1
|
|
|
|
|
NO , You cannot Calculate a String
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
if the format of your range remains the same, you can get the 'A' out and add one to its ASCII value and then change it back to 'B'. But I am not sure if it helps.
|
|
|
|
|
I am assuming this is XL.
You would do it like this...
Range("A1").Select
Offset(0,1).Select
Of course the (0,1) could be reassigned as variables and called within the Offset method.
That way you do the calculation then apply to the Offset and move around like that.
Hope that helps.
------------------------------------
"I want you to imagine I have a blaster in my hand" - Zaphod Beeblebrox.
"You DO have a blaster in your hand" - Freighter Pilot
"Yeah, so you don't have to tax your imagination too hard" - Zaphod Beeblebrox
|
|
|
|
|
I would like to know how many bytes are sent/received by my application which is using TCP/IP.
There are Windows Counters which let you know the total amount of data sent/received by RAS or LAN adapters but I didn't find code to know what my process is sending (execpt for some professional and expensive tools which monitors everything and are third party software).
I cannot just count my bytes because TCP/IP overhead is also present and I want to include that too in my statistics.
Thank you.
|
|
|
|