|
I have dragged a toolbar off the toolbox onto my winform. I then opened the Buttons collection and added a button.
I can't for the life of me figure out how to set the button's image.
Everything makes sense in someone's mind
|
|
|
|
|
KMAROIS wrote: I then opened the Buttons collection and added a button
Are you doing this at runtime or in the designer?
What about the DisplayStyle and Image properties
(assuming ToolStripButton class)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have figured it out. Thanks
Everything makes sense in someone's mind
modified on Friday, August 22, 2008 5:05 PM
|
|
|
|
|
Hello,
I would like to write a function in VS2008 C# that I can use in Excel2008.
I tried with this template that is available in VS2008 TeamSystem called "Excel 2007 Add-in" - when I write some code in this provided "ThisAddIn_Startup" function it works - but I would need to write my own function (e.g. something like: public int AddMe( int a, int b ) { return a+b; } ) which is accessible from within an excel cell like =AddMe(3,4).
Any help would be highly appreciated
regards, Dussel
|
|
|
|
|
I have a class that has a property that is a struct of two Int64s. Similar to the Size property which is two Int32s if that explains it better!
How can I get this to be usable in the property grid?
At the moment, as a workaround, I've made this property private and created another public property of type string and used the struct's ToString and TryParse methods in the getter and setter to alter the original property.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
I figured it out
For anyone that comes across this I needed to:
1. Create a convertor class that derived from ExpandableObjectConverter
2. Override CanConvertTo
3. Override CanConvertFrom
4. Override ConvertTo
5. Override ConvertFrom
6. Apply the TypeConverterAttribute to the property
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi,
Can We Use Windows Presentation Foundation in .Net framework 2.0?
|
|
|
|
|
No. It started in .NET 3.0. Are you trying to use something you created in WPF with something else done in .NET 2.0? That may be possible, but the WPF isn't in 2.0....
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
No but if the reason you're asking is because you're using vs2005 then you can add the extensions. Just google for vs2005 wpf
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi all im trying to convert a .dll call method from VBA to C#
VBA Code look like this:
Public Sub SnodAnrop()
Dim result As String
host = "***"
port = "***"
user = "****"
pass = "**"
cert = ""
cacert = ""
service = "**"
arg = vTyp & pnr & datumIn & datumUt
extra = ""
result = Space(1024)
buf = 1024
i = Module1.snod25x(host, port, user, pass, cert, cacert, service, arg, extra, result, buf)
SnodError (result)
If sFel = 0 Then
result = GVRSvar(result)
WriteToFile (result)
End If
Declare Function snod25x Lib "sn25.dll" Alias "****" (ByVal host As String, _
ByVal port As String, _
ByVal user As String, _
ByVal passwd As String, _
ByVal cert As String, _
ByVal CAert As String, _
ByVal Nodtjanst As String, _
ByVal arg As String, _
ByVal extra As String, _
ByVal result As String, _
ByVal Resultbuf As Long) As Long
And i have come this far in C#:
private string result;
[DllImport("sn25.dll", EntryPoint = "****")]
static extern int snod(string host, string port, string user, string passwd, string cert, string CAert, string Nodtjänst, string arg, string extra, string result, int buf);
private void button1_Click(object sender, EventArgs e)
{
result = new String(' ', 1024);
string user = "*****";
string pass = "***";
string service = "GVRPOSDIAP2";
int i = snod("*****", "****", user, pass, "", "", service, textBox1.Text ,"", result, 1024);
textBox2.Text = i.ToString();
textBox3.Text = result;
}
This two code strips are the same. In different language.
The Problem is that dont get any result back, its empty, but in the identical code in VBA its returning info at string result. My Question is how can i write the code in C# so a get back info at the string result????
The int i is giving me status back witch is 0 that meens OK but no info in return!!
Please Help Me!!
Thanks
|
|
|
|
|
My Fellow Coders,
Good day.
I need to write a .dll that will read and write to Excel and Access. Is there an existing code that I can use? Is there an example of how to do this that is endorsed by microsoft and the .net 3.0/3.5 framework.
I tried an ADO.Net approach but ran into errors and read on msdn that approach is not encouraged.
Any help you can provide would be great.
Thanks in advance.
BP
|
|
|
|
|
BlitzPackage wrote: I need to write a .dll
A .NET assembly? If yes you need to look into the Primary Interop Assembly[^] for each product.
led mike
|
|
|
|
|
Like led mike suggested, look into the Interop Library. I use it on a regular basis for client reporting tools and it is good to have around.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Gentlemen,
Thanks. Does the Primary Interop Assembly come with Visual Studio 2008 Professional?
Thanks again,
BP
|
|
|
|
|
BlitzPackage wrote: Thanks. Does the Primary Interop Assembly come with Visual Studio 2008 Professional?
Ok, uh try this, click on the link I gave in my post, then (and yes, I know this is very unpopular with programmers these days) READ THE ARTICLE.
led mike
|
|
|
|
|
LOL!!!
Hey, have some mercy, I'm new at programming
Thanks for the information. I think that will be what I need.
BP
|
|
|
|
|
BlitzPackage wrote: LOL!!!
BlitzPackage wrote: Thanks for the information. I think that will be what I need.
Sure. Like Paul said I think you will find it very easy to work with. Of course the complexity of the Object Models are still there but they provide all the conversions into .NET types for you so it's pretty sweet.
led mike
|
|
|
|
|
Hi, i got a LCD screen similar to this http://opencube.com.sg/lcd.jpg[^]
which is connected to the computer using usb. How do i write a program in c# to display a message to the LCD
|
|
|
|
|
You need to consult the documentation / data sheet from the manufacturer.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
can i use socket to somehow connect to that port?
|
|
|
|
|
You might want to read up on how to use USB ports and C#. Sure there are plenty of good reading materials out there on the subject.
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Unfortunatly you cant ... sockets are realted to networking ... what you are looking for is Serial Ports, specificly USB, you can find materials regarding Serials Ports and using them ... surly you will find something about USB in specific ... and dont forget to read the manufacturer sheet as well...
Sincerely Samer Abu Rabie
Note: Please remember to rate this post to help others whom reading it.
|
|
|
|
|
DaveyM69 wrote: You need to consult the documentation
Oh no, the dreaded "read the documentation" reply. Better duck.
led mike
|
|
|
|
|
lol
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Did it come with any sort of documentation?
"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
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|