|
hi all,
can any body tell me hw to get the hexaDecimal value of a certain number.
Also i need to know how to get the asc code of a certain character.
Best regards
|
|
|
|
|
Hello,
quiteSmart wrote: can any body tell me hw to get the hexaDecimal value of a certain number.
public string IntToHex(System.Int64 number)
{
return String.Format("{0:X}", number);
}
quiteSmart wrote: Also i need to know how to get the asc code of a certain character.
Sorry, don't know!
All the best,
Martin
|
|
|
|
|
Also i need to know how to get the asc code of a certain character.
public byte asc(char c)
{
return (byte)c ;
}
It might throw an exception for unicode characters that are not in the ascii table.
|
|
|
|
|
|
That's not too pretty. Better use System.Text.Encoding.ASCII.GetString()
Standards are great! Everybody should have one!
|
|
|
|
|
Thanks Martin
|
|
|
|
|
hi
i want my datagridVIEW rows has periodic color
for example :
row No color
0 white
1 blue
2 white
3 blue
. .
. .
. .
what can i do?
|
|
|
|
|
Example:
this.dataGridView1.Rows.Add("1");
this.dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Blue;
this.dataGridView1.Rows.Add("2");
this.dataGridView1.Rows[1].DefaultCellStyle.BackColor = Color.Red;
|
|
|
|
|
In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.).
I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime?
e.g. I have got one button on my tab page and if I click that button the back color of tab should change.
thanks,
|
|
|
|
|
Hello,
KrunalC wrote: I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.
You should stay at this solution.
At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages.
All the best,
Martin
|
|
|
|
|
Thanks for the reply.
Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.
|
|
|
|
|
Oh,
Good work!
All the best,
Martin
|
|
|
|
|
Hi
When I type turkish letters(Ğİö..) in a text box and try to pull data, it returns no row..
But when I type select command to SQL Enterprise manager and try to pull same data, it works...
My SQL command is "select * from myTable where (column1='Ğİ' COLLATE Turkish_CI_AI)
I make,
System.Threading.Thread.CurrentThread.CurrentCulture= new System.Globalization.CultureInfo("tr-TR");
in program init...
I put Language setting to form and Localizable=true
This problem only occurs on windows 2000 english, I have no problem with windows XP turkish
I hope I could explain my problem...
Thanks
|
|
|
|
|
i want to create a setup and deployemt project which creates three empty folder. and then i need the path or i say i want to access this path from my windows services. how can i do this???
|
|
|
|
|
To establish a connection from an aspx page to a word document stored in D drive.Then replace few words in document by words present in textboxes in aspx pages
Sowmya
|
|
|
|
|
Required for what? Homework assignment?
What is the point of your post? Have you encountered any problems writing this code? Do you have any specific questions?
---
It's amazing to see how much work some people will go through just to avoid a little bit of work.
|
|
|
|
|
u shud use word interop and word application object.
|
|
|
|
|
I am new to codeproject, and relatively new to C#. Eventually i got bored of... non-saving uses... and decided i needed to save something. So i tried.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace FileMaker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
Stream myStream;
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = saveFileDialog1.OpenFile()) != null)
{
StreamWriter wText = new StreamWriter(myStream);
wText.Write("CHEESE");
myStream.Close();
}
}
}
}
}
It doesn't work. When i run the program and click on the button, and go through the save file dialog, a file does appear, but "CHEESE" does not appear in the text file. I cannot figure out why this doesn't work. So how do i fix this so that "CHEESE" appears in the file?
Thanks to anybody who helps!
|
|
|
|
|
try closing the streamwriter before closing the stream...
Luc Pattyn
|
|
|
|
|
wText.Close();
MyStream.Close();
unless u close the writer, buffered things will not be explicitly fwded to the disk.
|
|
|
|
|
Hello,
I have created a list of items within a combo box control and would like to use the word "Other" at the bottom of the list to enable a textbox control. Currently I can get the textbox to enable by selecting any list item in the combo box, but unfortunately the textbox enables regardless of what item I choose. I just want the item "Other" to enable it and nothing else.
I can't seem to find anything within MSDN or the net that explains how to do this, and i've seen many applications that use "Other" to enbable a textbox so I know that it can be done.
can someone help?
Thanks!!
|
|
|
|
|
use a Combobox.SelectedIndexChanged event handler that contains
myTextBox.Enabled=myComboBox.SelectedIndex==otherIndex;
Luc Pattyn
|
|
|
|
|
Hi,
Not exist a special function or property. You have to do it manually adding the item "Other" to the list of items and asign it a special value. Then, in the "SelectedIndexChanged" event of the combo box check if the new selected index is the same that the "Other"...
|
|
|
|
|
Hi,
I haven't found an easy way out of a problem I have. I have a class which I would like to initialize from different sources - such as a DataRow, an IDataReader etc. Something similar to:
class MyClass<br />
{<br />
public void Load( DataRow row )<br />
{<br />
m_strName = row["Name"];<br />
m_strTitle = row["Title"];<br />
}<br />
<br />
public void Load( IDataReader reader )<br />
{<br />
m_strName = row["Name"];<br />
m_strTitle = row["Title"];<br />
}<br />
}
You will notice that the code inside these functions is identical. However, I haven't found a way to refactor this code into one common function, since both snippets rely on the indexing feature supported both by DataRow and IDataReader, but I cannot figure out if this could be refactored into a common function (DataRow and IDataReader have no common base classes or interfaces, except System.Object of course).
Has anyone a solution to this? I really hate duplicating code!
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
You might try something like this code; Note that this is code that I haven't tested at all though:
public void Load (DataRow row )
{
Load((object)row);
}
private void Load(Object x)
{
m_strName = DataBinder.GetPropertyValue(x, "Name", null);
m_strTitle = DataBinder.GetPropertyValue(x, "Title", null);
}
|
|
|
|