|
|
:-DHi, i have created a tab control with few tabpages, i would like to have an up button and a down button located outside of the tab control (but in the same form) that allows user to scroll the current selected tabpage. how can i do that? or which property/function allows me to do so?
Thanks Alot,
from a beginner
|
|
|
|
|
Hi. I am not sure but maybe you can check out the Panel class.
Hope it helps,
FJ
|
|
|
|
|
Hi Friends,
In my application, I have created with listview control with 3 rows with Green color as row background. By default row 1 is in selected state. If i want to deselect the row from the listview control by clicking anywhere above the third row. At that time the deactivation of the row is applied, but the row background is applied as white. This could be occured even i rearrange the column of the listview also. How can i restore back the background color for the listview row after deselecting the row or rearrange the column?
Please help me to solve this issue.
Regards,
Prakash.
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
I'm not safe from my own source according to VS2005.
So I built a sample solution in VS2005. After deployment of the solution to my own machine, I tried to add a csproj to the solution. Keep in mind I built these on my own machine. What does VS2005 say? Well, basically it says that MSBuild is a security nightmare in that it can run what essentially amounts to macros that could destroy my hard drive. Guess I'll never download another source project from myself and that I should really, really be sure about who I'm downloading source from. Wait, that's my source!
Halfway down this link is what MS has to say:
Linky to MS Build Overview
Anyone come across any workarounds so that anyone who downloads my csproj won't get this message?
Thanks!!!
Jim
|
|
|
|
|
how to declare a connection string in web.config and use it from there in our Web form
-- modified at 23:11 Friday 2nd December, 2005
|
|
|
|
|
Hi there,
The connection string depends on what kind of DB you are using.
the great site will give you all kind of Db Connection String
<< >>
|
|
|
|
|
<configuration>
<appSettings>
<add key="ConnectionString" value="connectionstring(depends on database)"/>
</appSettings>
<system.web>
Then u can use it as:
string connectionstring = System.Configuration.ConfigurationSettings.AppSettigs["ConnectionString"];
Regards,
Sandeep
+919891027854
|
|
|
|
|
Is there a way to set a single key as a MenuStrip item shortcut? When I try to set the ShortcutKeys value to 'P' (in the properties editor), I get an invalid property message.
-- K
|
|
|
|
|
Hello
I know not if I can post this here, because is C# + Interop, but I find not some sub forum about this.
I wish handle events of some SysListView32 object, But I know not if this is possible. I have the handle this object via FindWindowEx (like the spy++).
I have some samples using timers and checking the properties of the SysListView32, but I think timers a few odd, if we can use events and delegates.
I apreciate any help
Thanks
|
|
|
|
|
When I press F5 for debugging the Autodesk logo flashes and then goes away - with no error messages. Autocad2006 will not load from within Visual Studio 2003. I can manually run Autocad2006, use netload run the code but I cannot debug.
I have set up a project using the
New AutoCAD Managed CS Project Application wizard and the text in Lab1. The properties debugging are as per instructions and agree with the wizard.
Does having both Autocad2006 and CivIl3D cause a problem?
Gazza
|
|
|
|
|
Hi
I am having a code for 2 functions one is to Extract the file from a zip file. Another one is to read the Extracted file n parse it.
While Execution the application I am getting an exception The File(Extracted file) being used by some other application and its exiting by showing the line number "StreamReader sr = File.OpenText(FILE_NAME);".
But If I am debugging the application ..the results r perfectly fine.
Can Any one please explain this.
I am attaching the functions here
public static void ExtractZIPFile()
{
sbyte[] buf = new sbyte[1024];
int len;
java.io.FileInputStream fis = new java.io.FileInputStream(@"C:\TEMP\POWER_PRODUCTS.ZIP");
java.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(fis);
java.util.zip.ZipEntry ze;
ze = zis.getNextEntry();
java.io.FileOutputStream fos = new java.io.FileOutputStream(FILE_NAME);
while ((len = zis.read(buf)) >= 0)
{
fos.write(buf, 0, len);
}
zis.close();
fis.close();
FileProcessing();
}
public static void FileProcessing()
{
if (!File.Exists(FILE_NAME))
{
Console.WriteLine("{0} does not exist.", FILE_NAME);
return;
}
CreatePPTable();
StreamReader sr = File.OpenText(FILE_NAME);
String input="";
while ((input= sr.ReadLine())!=null)
{
String []strs = input.Split(';');
#region Add a row
DataRow drNew = dsPProducts.Tables[0].NewRow
drNew["PASS2_AVAIL_CD"] = strs[1];
...
drNew["PASS2_AVAIL_CD"] = strs[122];
dsPProducts.Tables[0].Rows.Add(drNew);
#endregion end of adding a row
Console.WriteLine(input);
}
sr.Close();
File.Delete(FILE_NAME);
}
|
|
|
|
|
Looks like you forgot to close fos in the following snippet.
dvsr wrote: java.io.FileOutputStream fos = new java.io.FileOutputStream(FILE_NAME);
while ((len = zis.read(buf)) >= 0)
{
fos.write(buf, 0, len);
}
When debugging, the GC must have run and closed it for you. That would explain the debug/release behavior.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi Sinthil,
Thanks for ur Help....
Once again its proved How dumb i am..
Thank you once again.
Subbu
|
|
|
|
|
Hi everybody.
I'm developing a program which has a combobox with all client names but as client name is not the primary key, or better: unique, on the database, some itens on the combo box are repeated, so this way there is more than one person with the same name.
In order to solve that I'd like to know if it is possible to associate another value (preferable an unique ID which would be loaded from the database) for each item on the combo box, but in a way that the program user would see only the name on the combo, not this unique ID, which would be used by the program.
If my explanation was not clear:
- I'd like to have this user view on the combo box:
John Wallace
Marck Keen
Isaac May
John Wallace
The way it is right now (no associated values) I can't do a query that would retrieve me only one row, because using "select * from table where name = ' + combo.SelectedItem.toString() + "'"; it would retrieve me 2 rows if, for example, I select John Wallace which has 2 occurences on the same combo.
So, behind the scenes, I'd like to retrieve the unique id from the selected item. So the program would have that:
John Wallace 344072407
Marck Keen 40947047
Isaac May 483609
John Wallace 20648
Thus, I can make a different selection based on the name, like:
"select * from table where uniqueID = ' + combo.SelectedItem."somethingThatWouldRetrieveMeTheUniqueID" + "'";
Thank you !
|
|
|
|
|
You could create a class like:
public class ComboEntry {
public string Name;
public int Id;
public override string ToString() {
return Name;
}
}
and put instances of it into the ComboBox. The ComboBox will call the ToString method to determine what text should be shown and when you access the SelectedItem property you can just cast back to ComboEntry and get the Id.
|
|
|
|
|
It worked the way I wished.
Thank you.
|
|
|
|
|
Set the DataSource of the Combo Box
and set display member as name
and set value member as id.
now u can get the id by --
int i=combobox.SelectedValue;
|
|
|
|
|
Is there possible to make a text box control skip interpreting certain keys without inheriting the class?
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Excluing native interop I don't think that there is a way.
Are you unable or just don't want to inherit from the TextBox? If you're unable, can you give us some more information on your situation?
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
The ideea is to make a class that recives\intercept key messages from a TextBox, process them and if necesary block the respective key from being processed by the TextBox.
The ideea of inheriting is not so great because this class should work with all kind of other control (richTextBox, comboBox, etc...)
Thank you!
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Yeah - subscribe to the KeyPress event. This event passes a KeyPressEventArgs which has a boolean Handled field. Setting this to true stops the message being passed on to the text box handler, so you can do your processing in this event.
Regards,
Rob Philpott.
|
|
|
|
|
Thanks for your answer, but I allready know this. The problem is that in a TextBox if you press for exemple the VK_LEFT the cursor moves to left if is a character there.
I want to intercept this type of key before processing and decide if it mut be processed or not. (KeyPress event work's only for char key's if I am not mistaking)
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
Ah, ok.
Well, you can intercept virtual keys using the KeyDown event which is fired prior to the KeyPress event.
eg. To disable the left cursor key:
<br />
private void textBox1_KeyDown(object sender, KeyEventArgs e)<br />
{<br />
if (e.KeyCode == Keys.Left)<br />
{<br />
e.Handled = true;<br />
}<br />
}<br />
You may still need to worry about mouse selection depending upon what you are doing...
Regards,
Rob Philpott.
|
|
|
|
|
Hi all!
I got a Windows Forms application where an event is fired from a secondary thread. When this event is fired, I call
this.BeginInvoke(new MethodInvoker(someMenuItem.PerformClick)); to simulate a menu item click.
This works fine, but when the event handler for someMenuItem pops up a modal dialog, this dialog appears more than once if the event re-fires before the first dialog is closed.
So I tried encapsulating someMenuItem 's event handler code inside a lock(this) {} and now only a single modal dialog is shown at most.
So far, so good.
But if the event re-fires now, all these events are suspended as long as the lock() statement is active and executed in row afterwards.
Is there a way to change the behaviour so that the events are discarded instead of being stored?
Thanks in advance for any ideas,
mav
|
|
|
|