|
comboBox1.SelectedValue and you have to use DataSource , DisplayMember and ValueMember .
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I have a list view with 3 columns and I want to display an image in 3rd column during run time.
I've not find any direct method to do this, Then I approached DrawSubItem event. But I am not able to achieve my requirement as it is continuosly paiting.
I think I need to go for customization. But I am new to C# and I am in need of somebody's help.
Can anyone please help me in getting the solution?
|
|
|
|
|
http://www.codeproject.com/KB/list/OAKListView.aspx[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi all,
How to convert html to pdf?
I am using Itextsharp.dll as my library, cause i found 2 other library but are under License so i cant use it
i tried to follow the ExpertPDF method of geting the property but i just cant not get it to work
private PdfDocument GetPDFConverter()
{
int pageWidth = 0;
int pageHeight = 0;
PdfDocument pdfConverter = new PdfDocument(pageWidth, pageHeight); <-- (The type 'iTextSharp.text.pdf.PdfDocument' has no constructors defined)
pdfConverter.GetRight = false; <--error also
return pdfConverter;
}
How can i do it?
As i not sure how to read the data from the library
Thank You
|
|
|
|
|
|
I would follow Yusuf[^]'s advice below where you posted a very similar question[^].
|
|
|
|
|
Hi,
I'm having trouble getting the UDPClient to work with C#.
The udpClient has connected and sent a signal to 127.0.0.1 on port 8050 with no exceptions thrown. On the below line of code,
int recv = server.ReceiveFrom(data, ref tmpRemote);
I receive the below exception error,
at System.Net.Sockets.Socket.ReceiveFrom(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint& remoteEP)
RemoteIPEndPoint is defined using the following line of code,
IPEndPoint sender = new IPEndPoint(IPAddress.Parse("127.0.0.1"),8050);
EndPoint tmpRemote = (EndPoint)sender;
Any ideas why it throws the exception and how to solve it?
modified on Thursday, March 12, 2009 1:02 AM
|
|
|
|
|
mrithula8 wrote: Any ideas why it throws the exception and how to solve it?
Nope.
That info is contained in the SocketException object that gets thrown. You need to catch it and either print it or use the debugger to view it and find out what's going on.
|
|
|
|
|
Hi,
I used the SocketException to catch the exception
It displays the exception that the existing connection was forcibly closed by the remote host.How do i find where the connection is getting closed?Can you give some suggestions
//client
private void SendMessage()
{
try
{
listBox6.Items.Add("Connecting....");
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8050);
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, 1);
listBox6.Items.Add("Connected");
byte[] data = new byte[1024];
String snd = "hello";
data = Encoding.ASCII.GetBytes(snd);
listBox6.Items.Add("Transmitting...");
sock.SendTo(data, 0,data.Length, SocketFlags.None, ipep);
listBox6.Items.Add("Sent...");
EndPoint tmpRemote = (EndPoint)ipep;
listBox6.Items.Add("Message received from {0}:");
listBox6.Items.Add(ipep.ToString());
data = new byte[1024];
int recv = sock.ReceiveFrom(data,0,data.Length, SocketFlags.None, ref tmpRemote);
String zz=Encoding.ASCII.GetString(data, 0, recv);
listBox6.Items.Add(zz);
if (zz == "Welcome to the Server")
{
lb9.Text = "Active";
lb9.BackColor = Color.Green;
}
else{
lb9.Text = "Inactive";
lb9.BackColor=Color.Red;
}
}
catch (SocketException e)
{
MessageBox.Show(e.Message);
}
}
//server
public static void start_server()
{
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 8050);
Socket newsock = new Socket(AddressFamily.InterNetwork , SocketType.Dgram, ProtocolType.Udp);
newsock.Bind(ipep);
Console.WriteLine("Waiting for a client...");
while (true)
{
try
{
EndPoint tmpRemote = (EndPoint)ipep;
byte[] data = new byte[1024];
Console.WriteLine("hai");
int recv = newsock.ReceiveFrom(data, 0, data.Length, SocketFlags.None, ref tmpRemote);
Console.WriteLine("gfgjfk");
Console.WriteLine("Message received from {0}:", tmpRemote.ToString());
Console.WriteLine(Encoding.ASCII.GetString(data, 0, recv));
String st = data.ToString();
data = new byte[1024];
string ss = "Welcome to the Server";
data = Encoding.ASCII.GetBytes(ss);
newsock.SendTo(data,0, data.Length, SocketFlags.None, tmpRemote);
Console.WriteLine("\nSent Acknowledgement");
}
catch (SocketException e)
{
Console.WriteLine(e.Message);
}
}
}
|
|
|
|
|
MSDN says that you have to call Socket.Bind(...) before you call Socket.ReceiveFrom(...) . I see where you're doing that in your server code but not your client. I'd try adding a call to that function to the client.
If you still have lots of problems getting Socket s to work then I'd suggest you take a look at the UdpClient[^] class. It simplifies a lot of things and makes sockets easier to work with.
|
|
|
|
|
Your exception is probably something to do with the buffer, offset, and size. here are some guidelines that may help you understand and solve your problem:
The "buffer" must be large enough to accomodate the largest UDP datagram you expect to receive. Make sure you have a buffer that is large enough for you application. For example byte[] buffer = new buffer[1024];
Next, "offset" is the index to the buffer. First recv this is probably zero (0). Next recv it may be advanced by the value from the datagram PDU, e.g. a size of payload. The key here is offet MUST be with the bounds of the buffer 0 to n.
You should advance the offset by the bytes recv'd like this (with error checking of ocurse):
int nbytes = recv(buffer, offset, size, ...);
offset += nbytes
"Size" is determines how much. Let's say your first read got a 12 byte Header and in this header you extract a length. Well that means you would have used 12 for the first recv, and the if the payload size from the Header was 146 bytes, then your second recv would be for that amount. BUT you must make sure the offset advances before the second recv. Make sure you process recv errors, such as:
int nbytes = recv(buffer, offset, size, ...);
if (nbytes > 0)
offset += nbytes;
else
ProcessSocketError();
Good luck
|
|
|
|
|
Hello.
I'm trying to get an object to go where a mouse click occurs, my XAML:
<pre><Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="bricksMenu.Window1"
x:Name="Window"
Title="Window1"
Width="640" Height="480" Background="Black">
<Canvas Name="baseCanvas" MouseDown="baseCanvas_MouseDown">
<Canvas Name="whiteSquare" Width="50" Height="50" Background="White" Canvas.Left="25" Canvas.Top="25"/>
<Canvas Name="redSquare" Width="50" Height="50" Background="Red" Canvas.Left="50" Canvas.Top="50"/>
</Canvas>
</Window></pre>
and the C Sharp behind:
<pre>namespace bricksMenu
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
this.InitializeComponent();
// Insert code required on object creation below this point.
}
private void baseCanvas_MouseDown(object sender, MouseButtonEventArgs e)
{
double mouseX;
double mouseY;
Point position = e.GetPosition(this);
mouseX = position.X;
mouseY = position.Y;
DoubleAnimation followMouseX = new DoubleAnimation(mouseX, TimeSpan.FromMilliseconds(600));
DoubleAnimation followMouseY = new DoubleAnimation(mouseY, TimeSpan.FromMilliseconds(600));
redSquare.BeginAnimation(Canvas.LeftProperty, followMouseX);
redSquare.BeginAnimation(Canvas.TopProperty, followMouseY);
}
}
}</pre>
The idea is you click on the black background, the red square goes to that point. However, I need to click on the red sqaure to make anything happen, even though the event dispatcher is not on that canvas. Any ideas?
Regards, E.
|
|
|
|
|
I fixed it myself by simply adding a stage sized canvas into the main canvas.
|
|
|
|
|
As a modestly skilled C++ programmer, would C# be my logical next step ?(when I say "next step", I mean in terms of learning another language, in this case specifically one I can use for scripting).
As I am just being introduced, really, to Web programming, I'm not really sure I should be learning ASP.NET yet, my thinking being that lower-level scripting is a prerequisite for this.
Would C# be appropriate?
|
|
|
|
|
|
Opera? Good to see someone is still using it!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Opera is best[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
hi all,
This is what i found on the web
public static PdfFileSpecification fileEmbedded(PdfWriter writer,String filePath,String fileDisplay,
byte[] fileStore,int compressionLevel)
{
Parameters:
writer - the PdfWriter
filePath - the file path
fileDisplay - the file information that is presented to the user
fileStore - the byte array with the file. If it is not null
compressionLevel - the compression level to be used for compressing the file it takes precedence over filePath
} <---- what to type inside?
So this help to transfer the html that have been converted to pdf to store inside a file ?
does anyone know how to convert html to pdf using C#?
Cause the web i find are about java
Thank you
|
|
|
|
|
YiXiang_89 wrote: Cause the web i find are about java
well, did you look into the java code. If you know C#, it should not be that hard to understand the java code.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I have a main form, from which i recive data from an usb hid device, i work fine
In my my main form i have th code
Form.ActiveForm.Invoke(new BuzzCmdDelegate(BuzzCmd),new object[] {1,1});
|
|
|
|
|
(sorry it subtmited on press on code block)
I have a main form, from which i recive data from an usb hid device, i work fine
In my my main form i have th code
Form.ActiveForm.Invoke(new BuzzCmdDelegate(BuzzCmd),new object[] {1,1});
I work alost, but i invoke on the main form, instead on invoke on the active form,
Both in my mainform og subform which is NOT an mdi child, i have pulic method called BuzzCmd.
How do i call BuzzCmd in the activeform from the main form?
|
|
|
|
|
thomaxz.tc wrote: (sorry it subtmited on press on code block)
you can use edit button on right-bottom of message
if all forms have same type then you can convert to that type and call the BuzzCmd
((Form1)Form.ActiveForm).BuzzCmd();
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hmm i work sorta, but which that method i have to cast every single form i have, now i have a rather simpel proejct where i can used that method, but if i have a proejct with many forms, i have to cast all 36 forms in 5-6 diffrent events, there much be something smarter.
|
|
|
|
|
if all 36 forms have same method and they are differ then why dont you create a base class add that method as virtual then override. Then you can convert it to that base class and call it.
but if you want to use Invoke() then the code you using suppose to work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
I don't get it, Base class? What do you mean?
Thsi i try to do is
Usb hid->MainForm (data arrived method)-> BuzzCmd (mainform)
-> BuzzCmd (frmAbout)
-> BuzzCmd (frm1)
-> BuzzCmd (frm2)
-> BuzzCmd (frm3)
depending on which one is active
Which i tried with
Form.ActiveForm.Invoke(new BuzzCmdDelegate(BuzzCmd),new object[] {1,1});
Which did'nt do as i have xped invoked on active form, but invoked on the form which the code was in.
Then you come with
((frm1)Form.ActiveForm).BuzzCmd(1,1);
I worked i then think what if i cast it to form
((Form)Form.ActiveForm).BuzzCmd(1,1);
But can't do that, because form doees not contain an medthoed BuzzCmd.
Edit:
Hmm, I try to make an form, with at virtual medthod, but wheni cast it to that, no form geet called, not the mainform, not the frmABout and not the Form1, when i try to overide i frmABout it says ther is no method to overide.
modified on Tuesday, March 10, 2009 10:44 AM
|
|
|
|
|