|
easy: listboxB.Items.add(listboxA.selectedItem)
|
|
|
|
|
Sadly I still havent got it working but thank you anyways.
|
|
|
|
|
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged<br />
ListBox2.Items.Add(ListBox1.SelectedItem.ToString())<br />
End Sub
Put that in the form code, obviously.
|
|
|
|
|
Cheers Mr/Mrs Faded, it turns out though that it was as simple as sticking an equals sign betwen the 2 box names.
|
|
|
|
|
Having a prob...
at the '''dim array and counter
Dim arrJobBreak(intJobBreaks) as String
is throwing an error, saying "Compile Error - Const Expression Required"
What have I done wrong here?
Public Sub CommandButtonOrderJobBreakBegin_Click()<br />
<br />
'''Dim and Load<br />
Dim intJobBreaks As Integer<br />
intJobBreaks = Val(TextBoxOrderJobBreaksTotal.Value)<br />
<br />
'''Check for minimum job break<br />
If intJobBreaks < 1 Then intJobBreaks = 1<br />
<br />
''' make job frame visible<br />
FrameOrderJobBreaks.Visible = True<br />
<br />
'''dim array and counter<br />
Dim arrJobBreak(intJobBreaks) As String<br />
Dim intJobBreakCounter As Integer<br />
<br />
'''load counter<br />
intJobBreakCounter = 1<br />
<br />
'''Array fill<br />
Do While intJobBreakCounter <= intJobBreaks<br />
arrJobBreak(intJobBreakCounter) = TextBoxJobBreakHeader.Value<br />
Loop<br />
<br />
''' confirm end jobbreaks<br />
MsgBox ("Job Breaks Complete")<br />
<br />
End Sub
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
Dalek Dave wrote: Dim arrJobBreak(intJobBreaks) as String
is throwing an error, saying "Compile Error - Const Expression Required"
I think the error says it all, you can only dim any arr with a constant, not a variable. Try doing a redim instead.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Of Course!
Thanks, I shall attempt that.
Brain must be turning to mush, I forgot about the Redim statement.
------------------------------------
"When Belly Full, Chin Hit Chest"
Confucius 502BC
|
|
|
|
|
Easy done - I try not to use arrays any more.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Ashfield wrote: I try not to use arrays any more
You use more expensive arrays then, there is at least one in almost every .NET collection class. Hidden, more expensive, redimming itself as required, and more comfortable.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
True enough, but easier on the typing finger
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hi to all,
I am facing this problem ....I have put a shock wave object on a form. When i run it, it runs fine....
Then i made a set up file. when i installed it in other machine its not running....
Wat are the necessary staff i need to do? May be some installation on the machine which i have installed the project?
It would be great, if i don't have to rebuild the project and install it again....
Please help me
-----------------------------
I am a beginner
|
|
|
|
|
Install Shockwave on the target machine.
|
|
|
|
|
thanks for the reply......But i am little confused Sir
Do you mean installing Shockwave player?....or something related to dll
-----------------------------
I am a beginner
|
|
|
|
|
Yes, the Shockware Player. It's supplying the COM library your code is using.
|
|
|
|
|
i installed it, but still its not playing the video....but the sound is playing....please help me out
-----------------------------
I am a beginner
|
|
|
|
|
I have no idea what's wrong and no way to try and replicate the problem.
|
|
|
|
|
Hi all
I m facing a problem with creating Instance of Categories Interface.
I copy this code from MSDN and try to execute in vb.net application.
Dim instance As _Categories
Dim Name As String
Dim Color As Object
Dim ShortcutKey As Object
Dim returnValue As Category
returnValue = instance.Add(Name, Color, ShortcutKey)
But it is showing Error "Object reference not set to an instance of an object."
Here is the link of msdn. Can anyone solve this problem and give me suggestion with the help of code...
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._categories.add.aspx[^]
Plz help it's urgent.
Regards
DC
|
|
|
|
|
I'm guessing that you are getting this error because you have declared the variables Color and ShortcutKey but not instantiated them.
|
|
|
|
|
Thanks for quick response Liqz.
Can u give me sample source code.
my code is below
Dim category_Color_Obj As Outlook.OlCategoryColor = OlCategoryColor.olCategoryColorDarkGreen
Dim category_Key_Obj As Outlook.OlCategoryShortcutKey = OlCategoryShortcutKey.olCategoryShortcutKeyNone
Dim Name As String = "DC Category"
Dim Color As Object = category_Color_Obj
Dim ShortcutKey As Object = category_Key_Obj
Dim returnValue As Category
Try
Dim instance As Categories
returnValue = instance.Add(Name, Color, ShortcutKey)
catch
msgbox "error..."
endtry
Here returnValue is showing with green line. so error is comming.
regard
dc
|
|
|
|
|
I can't give you sample code as I have never done what you are doing before. But looking at your code it looks OK to me apart from where, again, you declare a variable called 'instance' of type 'Categories' but you don't actually create an object of type 'Categories'. If the 'Add' method is an instance method rather than a class or shared method then you must create an instance of that object. Try using the 'New' keyword.
If you still get an error then post it here.
|
|
|
|
|
Categories is an interface, not a class according to MSDN example.
so we can't use new keyword. If i use new keyword then it is showing blue line in returnValue obj.
plz try this example and solve it. It's very urgent.
What is my task, I want to add new contact in outlook with category wise.
i want to add contact with color symbol as we do in outlook 2007 by category color.
regards
dc
|
|
|
|
|
Ah ok. I may be well off the mark here and maybe someone can correct me if so, but you can't call an interface's method directly as it doesn't contain an implementation of that method, only a signature. Therefore, you need to use an object that implements that interface and call the 'Add' method of that object. (A quick Google searched showed that Microsoft.Office.Interop.Outlook.CategoriesClass implements the Categories interface, maybe that is where you should be looking).
Sorry I can't be of more help but I haven't really used the Office Interop assemblies much.
|
|
|
|
|
Ok
and thanks for quick reply
regards
dc
|
|
|
|
|
Hi Liqz
Can any guide me to solve my problem.
i create a setup of outlook VSTO add-in. This setup is not working in Both Winodow XP and Vista.
So my friend suggest me that to write code in Outlook Share Add-In. I again create this share Add-in Setup
and try to run in both machine. But Unfortunately it is not working in XP. And working successful in Vista.
Can any one guide me which file needed to add in XP so my Share Add-in Work on XP also
Regards
DC Confused
|
|
|
|
|
how to convert ascii to hexa using vb?
for example...hexa 13 = ascii 31(1) 33(3)
now i have it in ascii but i need to combine and convert this into 13 instead of 31 33...
i need to create a function to do this in a class library den after dat call it from the app source code
help please!!
thanks alot!!
|
|
|
|