|
Hi all,
i need set the position for ascii char in richtextbox.
Here is my coding that will show the ascii char in richtextbox.
string hex = "040";
string hex1 = "025";
string hex2 = "023";
string hex3 = "025";
int code = Convert.ToInt32(hex,16);
int code1 = Convert.ToInt32(hex1,16);
int code2 = Convert.ToInt32(hex2,16);
int code3 = Convert.ToInt32(hex3, 16);
richTextBox1.Text = Encoding.Default.GetString(new byte[] {(byte)code,(byte)code1,(byte)code2,(byte)code3});
Now i need arrange all the ascii char in correct position.I hd tried in many ways,but still got errors.pls help me.
Thank you.
KAMALES
|
|
|
|
|
try in this way :
byte mychar = 40;
richTextBox1.Text = ((char)mychar).ToString();
hope it will help
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-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
well I need to display the customerID, firstName, and lastName from a table called customers into a listbox. The idea is that I want the user to view what customers are in the database and then pick one to update or delete. Then it will take you to a diffrent form where you can update or delete the customer.
|
|
|
|
|
sounds fun, what have you tried ?
Can't you just set the datasource of the listbox, or do you need to add columns in code ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I don't think I need to add columns in code. I just need a listbox to display an ID number, first name and last name from a table in my database. We have connection to the database. I just need to know how to code the listbox to show these columns of my table.
|
|
|
|
|
Does it have a datasource property ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I do not have a datasource. All I know is that I have a connection to the database and i know the select statement i need to put into the code.
|
|
|
|
|
Then when you call the SQL, you'll have a dataset. Which is a datasource.
So is an array, as it happens.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can you show me an example of this so I can have a better idea.
|
|
|
|
|
I'm kind of confused. You have SQL, but you don't know how to use it to get info into C# ? Have you done any research ? Is it a SQL Server DB ? Do you know how to create a connection string ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
precado999 wrote: I don't think I need to add columns in code
I think u need to add column the to display the data from the Database.
Set the listview property to details. Then add columns
lyk:- listview.Columns.Add("Heading", width, allignment)
same for another column you want to add.
then create a datatable from database with the data u want, in ur case ID, FName, LName.
Loop thru the rows to show the data.
foreach(DataRow dr in dt.rows)//here dt is for datatable
{
listview.Subitems.Add(dr["ID"].tostring());
//same for Fname,
//& so on.....
}
The code here here is not syntactically correct.
Hope this will help you.
|
|
|
|
|
hello, id like to run console program from C# gui and catch its output and i have a problem that text in console is bigger than standard console width. is there a way how to set console width in C# for that process ?
maybe there is option in process.StartInfo how to use console with bigger width than standard 80 chars?
|
|
|
|
|
Hi,
I don't know you can do that programmatically, but maybe this helps: you can set it
manually by right-clicking the console window title, change window size and buffer size,
then save choosing "save for all windows with same title".
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
thank you for reply
i already found this but it didnt help and it still cuts characters that dont fit in standard width
|
|
|
|
|
dwrst wrote: it still cuts characters
I don't think so. I just ran it with a width of 170 characters, and it works great.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
really? and you launched it as process (external application) and you can read 170 characters per line from it? because it doesnt work for me.. so maybe the problem is in stream reader? im using this code http://www.codeproject.com/KB/threads/launchprocess.aspx
|
|
|
|
|
Hi,
no, sorry, it is a console app that outputs to a wide console it owns.
if the app is an existing app it may have its own limitations, and/or it may assume
its console is 80 char wide.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I dont think u can set width standard console window in C#, but may be can by C++.
|
|
|
|
|
System.Console has a number of methods (and properties) that may help
SetWindowSize
WindowHeight
WindowWidth
LargestWindowHeight
LargestWindowWidth
But, as Luc said, the app may break lines before the edge of the window.
|
|
|
|
|
Does anyone know how can I possibly update or refresh a combobox that's on another form (or how can I update this form)?
|
|
|
|
|
Is the form part of your project ( I expect not ) ? You can get the handle of the combo box and send it WM_ messages, but it sure is nasty, I would not recommend it
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
The form is a part of my project.
I have two forms. One is MainForm, and on it is a databind combobox. There is also a button, and when the user clicks it, it takes him to another form where he can enter some new information and add those information to a datasource to which my combobox is connected to. That information should then be displayed in combobox, but I need to refresh it first, and I have no idea how to do that.
|
|
|
|
|
Ah, OK. Now I understand the question, use a delegate to inform your main form that an event on the subform means it needs to refresh the combo box
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok, thanks
|
|
|
|
|
Hello all.
I'm designing a small app that takes a bitmap image as an input, compares it to a database of images, and returns the image it is most similar to.
The matches will not be exact (i.e. they may be of the same subject but at a slightly different angle, zoom, etc.).
What I'd like to know is what aspect of the image you'd suggest to use for this comparison (binary image pixels, histogram, etc.) and how to make a match when the images will not be exact copies.
I'm coding this in C# and any code specific answers would be appreciated as well.
Thanks.
- Alex
|
|
|
|