
dynamic_sysop
Leaders
-
Posts
1044 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by dynamic_sysop
-
s'ok i've sussed it:) int c=Convert.ToInt32(Color.Red.R.ToString()); MessageBox.Show(c.ToString()); // gets the r value , g for the g value etc...
-
convert system.color to integer ? hi does anyone know if it's possible to convert a colour to integer? i can put some code together and run my app , but when i click a button to test it, it errors. i have managed to get it to show a value ( rgb i think ) like this : int c=Convert.ToInt32(Color.AliceBlue.ToArgb()); MessageBox.Show(c.ToString()); but i want to be able to get the int value of the actuall colour not the rgb:-\
-
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
thanks for the help on this , the dll is not working correctly , i've tried a winsock dll and that works how it should so there's something wrong with the dll i was using i think. -
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
nope but i did this: this.socket.OnConnect += new SOCK.__Socket_OnConnectEventHandler (this.OnConnect()); /// private void OnConnect() { } that stops an error showing, but when i send OnConnect(); from a button and try to connect my socket it says cannot change ref object to string :-\ it should do this: socket.Connect("remote host here" , "remote port here"); -
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
cheers divil, i found this: public sealed delegate __Socket_OnConnectEventHandler : System.MulticastDelegate Member of SOCK but no matter how i impliment it nothing matters it still throws an error. so i'm not sure if it will run. -
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
to elaberate further , this is the error message i'm getting : Method 'WindowsApplication3.Form1.On_Connect(object, SOCK.__Socket_OnConnectEventHandler)' does not match delegate 'void SOCK.__Socket_OnConnectEventHandler()' -
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
cheers for the reply , i'm nearly there but i get this: this.socket = new SOCK.SocketClass(); this.socket.OnConnect += new SOCK.__Socket_OnConnectEventHandler (this.On_Connect); /// this i have in the designer area /// this line >> this.On_Connect << gets highlighted still /// /// this is my code in the form... private void On_Connect(object sender, SOCK.__Socket_OnConnectEventHandler e) { } no matter how i change it always the same line gets highlighted:-\ -
is there a way to reference a dll and it's events in c#?
dynamic_sysop
replied to dynamic_sysop
's topic in Visual C# .NET
i tried this... using SOCK; /// this.On_Connect += new SOCK.__Socket_OnConnectEventHandler(this.On_Connect); /// highlights this >>> this.On_Connect <<< /// private void On_Connect(object sender, SOCK.__Socket_OnConnectEventHandler e) { } i cant get it to do "this.SOCK" etc -
i have a dll which i use in vb.net without a problem , but i want to try it in c#, i've added a reference , then at the top of the form got... using SOCK; //this is the name of the dll. then i've tried ... this.SOCK // but it doesnt do anything any advice on how i can reference my dll and get it to actually do something would be great ty.
-
Dim strString As String strString = "some text" strString = Replace(strString , Chr(32) , "" ) '// strString now would show as "sometext"
-
i think word calls the common dialog for open / save like you can with any app , the save it will have an api for an event like user logging off / system shut down
-
getprivateprofilestring API Help needed
dynamic_sysop
replied to hemenkap's topic in Interoperation / Office Integration
sorry about the delay lol. Imports System.Text '///at top of code page^^^ <DllImport("kernel32.dll")> _ Private Overloads Shared Function WritePrivateProfileString( _ ByVal lpApplicationName As String, _ ByVal lpKeyName As String, _ ByVal lpString As String, _ ByVal lpFileName As String) As Integer End Function <DllImport("kernel32.dll")> _ Private Overloads Shared Function GetPrivateProfileString( _ ByVal lpApplicationName As String, _ ByVal lpKeyName As String, _ ByVal lpDefault As String, _ ByVal lpReturnedString As StringBuilder, _ ByVal nSize As Integer, _ ByVal lpFileName As String) As Integer End Function '/// under the designer generated code area^^^ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click WritePrivateProfileString("this", "KeyName", "This is the value", "c:\test.ini") Dim str As New StringBuilder(256) Dim l As Integer l = GetPrivateProfileString("this", "KeyName", "Default", str, str.Capacity, "C:\test.ini") MsgBox(str.ToString()) End Sub took a bit of messing about but i got it to run , the basis of it is from a vb6 code on allapi.net, but i modified it all to work in .net -
Try Shell("", AppWinStyle.NormalFocus, True) '// your code would go here '/// i made this to purposely throw an error '/// basically it tries to open something that doesnt exsist Catch MsgBox("error: " & Err.Description) End Try hope this helps
-
straight from msdn: Imports System Imports System.IO Class Test Public Shared Sub Main() ' Create an instance of StreamWriter to write text to a file. Dim sw As StreamWriter = New StreamWriter("TestFile.txt") ' Add some text to the file. sw.Write("This is the ") sw.WriteLine("header for the file.") sw.WriteLine("-------------------") ' Arbitrary objects can also be written to the file. sw.Write("The date is: ") sw.WriteLine(DateTime.Now) sw.Close() End Sub End Class hope this helps:)
-
cheers :) i thought i'd experiment with an api:-\ [DllImport("User32.Dll")] public static extern int GetWindowText(int h, StringBuilder s, int nMaxCount); //// under the form's designer area. //// private void button5_Click(object sender, System.EventArgs e) { StringBuilder strString = new StringBuilder(256); //buffer for the text we want to receive. int i; i = GetWindowText(this.button1.Handle.ToInt32(),strString,256); MessageBox.Show (strString.ToString()); } and it works:D this is cool:p
-
this did it... string word = "hello i'm a test".Split(' ')[1]; MessageBox.Show(word); i got a little bit of help at the codeproject:) cheers for the quick replies though
-
all of the above return errors:-\ this 1: String str = "Test 123"; MessageBox.Show(str.Split(new Char[] { ' ' }), 1)); highlights at the end and says "invalid expression ')'"
-
i'm on that thanks , although i am getting an error like this... The best overloaded method match for 'string.Split(params char[])' has some invalid arguments the way i'm trying is this... string str = "test 123"; char buff = Convert.ToChar( " "); MessageBox.Show(str.Split(buff,1)); any ideas?
-
hi does anyone know if there's an equivalent to Split in c# ?
-
Comm Object Programming
dynamic_sysop
replied to DanTheMan's topic in Interoperation / Office Integration
go to Project on your top menu in vb.net , then select Add Reference. then you'll see the box open to add com objects:) -
it's ok if you click a button and then load a form eg: Dim frm as New Form1 frm.AddText( Text ) frm.Show() but what if you want to load form1 , click on it to open form2 then on form2 click a button to set some text on form1. because if you Dim frm as Form1 it's null and if you Dim as new it must make another instance of form1 and add the text to that 1 ( which you cant see ):-\ there must be a way to reference both forms to eachother on start up so that you dont need to create new forms.
-
hi this may not quite be a .net ? but maybe someone has an answer. when i'm navigating any site and click on a link to open in a new window ( eg: if someone posts a thread on this board and you click it , it opens up in a new window ) nothing happens :-\ , since i rebooted a few days ago i click a link and i just stay sat on the page i'm on , the link wont open in a new window ( or the same window ) , so far i've tried rebooting many times , i've updated any needed xp files ( i'm on xp home edition ) i've tried resetting all my ie settings and security settings but i'm completely baffled. maybe someone knows of a problem with ie and a fix? cheers.
-
you need SumTextBox.Text to be SumTextBox.SelectedText otherwise the original text will be replaced. and just add VbCrlf at the end.
-
can you not Dim node as Object? then convert it to what you need? what are the items in the Structure? you must have them as something like Integer or String or something?
-
Public Function Get_ (ByVal nome As String, ByVal type As String) Dim posi As Short Dim node As String '/// make it a string or what you want first Select Case type Case "pizzas" node = node_pizza file = 1 Case "drinks" node = node_drinks file = 2 End Select FileGet(file, node, 1) posi = node.next FileGet(file, node, posi) While (posi<> 1 AndAlso String.Compare(Trim(node.name), name) <> 0) posi = node.next FileGet(file, node,posi) End While Return posi End Function