|
System.Diagnostics.Process.Start
Eslam Afifi
|
|
|
|
|
I have 6 tabs on my windows forms. I want it to change tabs with I click the next button can you any help.
Shelby Learning the Code!
|
|
|
|
|
Call SelectedTab and select the tab you want.
|
|
|
|
|
private void Navigate()
{
//this.tabControl1.SelectedTab = this.tabPage1;
//this.tabControl1.SelectedTab = this.tabPage2;
//this.tabControl1.SelectedTab = this.tabPage3;
//this.tabControl1.SelectedTab = this.tabPage4;
//this.tabControl1.SelectedTab = this.tabPage5;
}
This is what I have. I need with I click the Next button it on to tab 2 if I press again tab 3 and so on. I click the previous button it goes backward.
Shelby Learning the Code!
|
|
|
|
|
So keep track of which tab you're on and use that as the basis for navigation.
|
|
|
|
|
Need help in writing this.
Shelby Learning the Code!
|
|
|
|
|
Name 2 buttons "btnPrev" and "btnNext". Name a tab control "tabControl1". Create "Click" event handlers for the two buttons and put the code in them like this:
private void btnPrev_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex > 0)
tabControl1.SelectedIndex--;
}
private void btnNext_Click(object sender, EventArgs e)
{
if (tabControl1.SelectedIndex < (tabControl1.TabCount - 1))
tabControl1.SelectedIndex++;
}
|
|
|
|
|
Hi,
I found several answer about typedef with "using" but it doensn't fit to my problem...
I'd like to do something like this in C#
typedef float Real;
because, someday I may need to create my own class Real and then I wouldn't need to replace every word (I know I could use the visual studio editor "Replace All" option, but I think it's too dangerous if I'm in the middle of a project that could have up to 1000s of files.
Thanks,
Dirso
|
|
|
|
|
However, you could create a wrapper class at the expense of speed. It really is unfortunate that you cannot inherit base types in .NET.
Another option which is more sloppily elegant ... Create a new class whose only method is a static, implicit operator that converts between itself and the type you want.
Then declare your code using floats in the following manner:
float myFloat = ((MyClass)5f);
When it comes time to change the value of the float change the implicit operator's type and you will get compile time errors showing you every location that needs to be changed.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
What have you tried so far? In what way does it not fit?
|
|
|
|
|
C# has a very natural equivalent for this:
The C# equivalent of:
typedef float Real;
is simply:
using Real = System.Single;
Note that you can't use the C# aliased name on the right side, it must be the 'proper' type name.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
My problem about that is that I'd like to define it once, not in every single file.
Thanks anyway for trying,
Dirso
|
|
|
|
|
Oh, then pass your code through the C-preprocessor, it's good at hiding details like that.
|
|
|
|
|
I have a reference to a web service, which has its URL "hard-coded" (not really, because it is part of the settings).
Here, we must fetch application settings elsewhere (it is the SSO configuration store).
I could do the following:
MyWebService s = new MyWebService();
s.Url = "some url";
s.MyMethod();
But I would prefer the following:
MyWebService s = new MyWebService("some url");
s.MyMethod();
I noticed that the C# code generated declares the MyWebService class as partial. Is there a way I could provide a partial implementation of that class, where there would be a constructor taking a URL as its parameter?
I tried, but it did not work. I remember that you could do it with editor-generated typed datasets.
|
|
|
|
|
I would guess you can create a partial class with a constructor that takes the URL. You said this didn't work - what happened exactly?
|
|
|
|
|
Hey all,
I was wondering if there is a way to make specific rows in the checkedlistbox disabled (no able to toggle the check mark). I want to be able to list some options which are mandatory and have others optional.
If there is a better control for this, I'd happily switch ;D
Thanks!
Mike
FREE 28 player online game @ http://www.1483online.com where the community drives enhancements to the game!
|
|
|
|
|
CheckBoxList1.Items[0].Enabled = false;
Where 0 is the index of the item to disable. You could do this in a loop or bind a bool value from your datasource depending on how you're populating it (the CheckBoxList).
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
What are you casting the item as? When I do that it doesn't work because it's an object, and doens't have the enabled property.
FREE 28 player online game @ http://www.1483online.com where the community drives enhancements to the game!
|
|
|
|
|
Are you doing this as winforms or asp.net? Either way the CheckBoxList control has an Items property, the Items property takes a collection of ListItem objects, ListItem objects have an Enabled property.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
Hey all,
Couple questions for this topic. Firstly, can someone tell me if it's "legal" to update files for my application (stored completely within the folder specified during installation) without prompting the user?
Secondly, I had two avenues I was considering going with this.
A) Keep track of all files in the folder by CRC32, post to a website which checks against the database to see if it matches the latest file, if not, download and overwrite (or if non-existing, just download of course).
B) Keep a tar ball on the server and check the Application.ProductVersion of the application against the server, if it's not the correct version, Process.start() my update manager, close the application (update manager will wait until the process is closed), download the tar ball, and extract (force overwrite).
I think option B) is the easier option in terms of managing, however, I cannot find a way to tar/untar a folder. C# has GZip and Deflate which, I guess, are fine for single files, but not folders. I found 2 libs out there (vwm-cvs and SharpZip, I think), but have found limited documentation. I'd like to just be able to include a dll and be on my way, or use existing features of the framework (optimal).
Any suggestions on a better way to do this or how to make one of these ways work and remain manageable?
Thanks!
Mike
FREE 28 player online game @ http://www.1483online.com where the community drives enhancements to the game!
|
|
|
|
|
Are you thinking perhaps of ClickOnce[^]?
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
I can't stand clickonce ~_~ I use that for another application we have and it's too restrictive.
FREE 28 player online game @ http://www.1483online.com where the community drives enhancements to the game!
|
|
|
|
|
I have the following code:
string sProvider = "msdaora";
string sServer = "CIS-SERVER";
string sDatabase = "ORA92SID";
string sUserName = "kevin";
string sPassword = "abcdefg";
string sConnStr =
"Provider = " + sProvider +
";Data Source =" + sDatabase +
";User Id =" + sUserName +
";Password =" + sPassword + ";";
OleDbConnection oConn = new OleDbConnection();
oConn.ConnectionString = sConnStr;
try
{
oConn.Open();
}
catch (OleDbException e)
{
Console.WriteLine(e.Message);
}
I am getting the error "ORA-12154: TNS:could not resolve service name".
I'm new to Oracle so I don't know what this means. I don't think there's an Oracle provider for .Net installed on this PC, so I'm guessing I'll have to use the default MS provider 'msdaora'.
Of course, I could be totally lost here too.
Everything makes sense in someone's mind
|
|
|
|
|
actually this is OOT of this forum, but you have to install oracle client in your installed machine and define service name in tnsnames.ora
for detail try this link[^]
there are many promising results
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
The problem is that when the provider tries to read TNSNAMES.ORA, it doesn't find entry for CIS-SERVER. Check that there is a definition for this server and the name matches.
TNSNAMES is located in oracle home under \NETWORK\ADMIN or it is routed to somewhere else using TNS_ADMIN either in environment variables or registry.
Hope this helps,
Mika
P.s. I think that you should next time post this kind of question to SQL and Databases forum
|
|
|
|