|
this code sample load control at run time
Button b=new Button();
b.Name="b1";
b.Text="Text";
b.Location=new Point(25,25);
//add to form
this.Controls.Add(b);
|
|
|
|
|
what do you want to hide at runtime tab control or tab page if you need to hide tab page like mav.northwind said
|
|
|
|
|
hi
at runtime i want tabcontrol to be invisible.. only after i click on some buttons then the tabpage will show.. (i made it to be a particular button will call a particular tab page)
thanks =)
|
|
|
|
|
//to make tabcontrol invisible
tabControl.Visible=false;
//to select particular tabpage
tabControl.SelectedTab=tabPage2;
|
|
|
|
|
I need to add colums to a datagrid.Anybody can tell me how can I do that?
|
|
|
|
|
hi all,
I need to change the Background Color of DateTime Picker.But in the properties, There is no place to change it..
Can any one tell me how to change the Background Color of DateTime Picker using C# ?
thanks in advance..
|
|
|
|
|
Hi all:
Im using Office Programming for my Automation App.
Everything is ok but there is a little problem. I've added an event on BeforeSave for my opened word from App. (the instance from Word.Application) then in BeforeSave even I save the content in a database & its ok then I close the word & then quit the word as follow:
Doc.SaveAs(.........);<br />
Doc.Close(ref TempObj, ref TempObj, ref TempObj);<br />
dbWord.Quit(ref TempObj, ref TempObj, ref TempObj);
TempObj = System.Reflection.Missing.Value
It saves, close & quit word but Office gives me an error.
does anybody seen it!
Always ,
Hovik Melkomian.
|
|
|
|
|
Im trying to send a string with the value:"\xHexaValue" to a vb application.
The HexaValue is of an Ascii code from the charachter table 128-255.
In the VB application Im searching for that value (chr(&HHexaValue)) but the value which was sent was converted to the NOT value of the actual value in Hexa. I tryed use the Encoding methods but without success.
|
|
|
|
|
From where or what are you sending the string? Does it really use ascii code?
Either the value is not converted at all, and still remains as \xnn in the text, or whatever you use to enter the string converted it to a character in a different character set, perhaps ansi or unicode.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hi.Im actually working on a datagrid which shows data from an Access database.I was working till know only with one table so my dataset is configured for one table only.How can I add other tables from the Access database I was using without beggining other C# solution?
|
|
|
|
|
How are you configuring the dataset ? Ideally, you'd have a data access layer which returns datasets based on any SQL query you like.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
And your data access layer can be configured to return another table that can be added to your existing dataset at runtime. Thanks.
modified 17-Jul-19 21:02pm.
|
|
|
|
|
Yes it is working on a SQL query cause actually im going through the Microsoft sample of datagrid using.Now I want to do some stuff by myself thats why need to add some tables.Thank you
|
|
|
|
|
depends on what you want.
Your DataSet can hold multiple tables.
(eg. query = "Select * from TableOne;Select * from TableTwo"; )
When you execute it and Fill the DataSet you'll have two tables in your dataset.
(then you can even set constraints and relations...)
thus:
yourdataset.Tables[0].Whatever;<br />
yourdataset.Tables[1].Whatever;
you can also create a DAL (data access layer which you can reuse.
eg. create a method which takes a query and returns a dataset.
Then you can do something like this:
DataSet myset1 = DalComponent.DoSelect("Select * from TableOne");<br />
DataSet myset2 = DalComponent.DoSelect("Select * from TableTwo");
(don't forget to create a new DataSet in your DoSelect method.
good luck.
No hurries, no worries.
|
|
|
|
|
Hello,
I added a MouseHover event on my usercontrol... just noticed that it uses the argument EventArgs instead of MouseEventArgs, is there a way to get the coordinates of the mouse pointer that is hovering over the control? Or maybe there's a workaround?
Thanks!
Rafferty
|
|
|
|
|
Hi!
You can always use Cursor.Position to retrieve (or set) the position of the mouse pointer.
Regards,
mav
|
|
|
|
|
Ahh! hehe didn't know there is such a class. Thanks Mav!
Rafferty
|
|
|
|
|
Hi,
My requirement is to export Russian Data stored in Oracle 9i Database to a CSV file.
When the below code is used to export data the Russian Characters are shown as Junk characters when the CSV file is opened in MSExcel. If the same file is opened in Notepad, the Russian Characters are displayed correctly.
Can someone advice, how to export Russian Characters that can also be displayed correctly when viewed in Excel Sheet.
It will be highly appreciated.
With Regards,
/////////////////////////////////////////////////////////////////////////////
/////////////////////// PROGRAM CODE ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
String strFileName = "";
FileStream fs = null;
BufferedStream buff = null;
StreamWriter writer = null;
bool bExported = false;
try
{
SaveFileDialog saveFileDlg = new SaveFileDialog();
saveFileDlg.Filter = "CSV Format|*.csv";
saveFileDlg.Title = "Save File";
saveFileDlg.RestoreDirectory = true ;
saveFileDlg.ShowDialog();
if(saveFileDlg.FileName != "")
{
strFileName = saveFileDlg.FileName;
saveFileDlg.Dispose();
fs = new FileStream
(strFileName,FileMode.OpenOrCreate,FileAccess.ReadWrite);
buff = new BufferedStream(fs);
writer = new StreamWriter(buff);
writer.Write(strWriteData);
writer.Flush();
bExported = true;
writer.Close();
buff.Close();
fs.Close();
}
return bExported;
}
catch(Exception exp)
{
throw exp;
}
finally
{
writer = null;
buff = null;
fs = null;
}
|
|
|
|
|
CSV files is really a mess, as there is no standard at all to rely on...
You have to find an encoding that the destination program can handle, and use the System.Text.Encoding classes to convert it.
Example:
UTF8Encoding utf8 = new UTF8Encoding();<br />
Byte[] encodedBytes = utf8.GetBytes(unicodeString);
---
b { font-weight: normal; }
|
|
|
|
|
When some action has been added to a context menu in Windows Explorer using a Verb such as "save" (which is not the default action), how to access that Verb from the Main function of the program which is invoked from such Context Menu item in explorer, i.e., how to choose as to which action is to be taken depending upon the command-line arguments?
Is there any sample code for this purpose?
Thanks.
|
|
|
|
|
Just check the arguments that are passed in, and branch accordingly. static void main has a string array passed into it, that's the arguments collection.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks.
But, arguments show only the filename on which the context menu was clicked. What about the "Verb" or the action such as "save"? I mean how to check whether context menu item corresponding to Verb "open" was clicked or Verb "save"? This is relevant when more than one context menu items are placed by one application.
Thanks in anticipation.
|
|
|
|
|
OK, I get it. Try this[^] MSDN page.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi all,
The dateTime is showing in a Label like this:
this.label1.Text=DateTime.Now.ToString("dd ,MMMM ,yyyy");
Now suppose that this program open in 24 hours ..Then How can I change date Time of the Label Continuously with out using a Timer?
Can any one send me better url to download DateTime Components with attractive skins?
thanks in advance..
|
|
|
|