|
*grin* I think you misunderstood the question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
No I dont think so, in backup applications it is important to copy all source files;
buying/downloading a new app that uses new extensions is fine, as long as you dont
forget to add the new extensions to the backup utility, unless it recognizes
texts all by itself...
Of course for non-text files, it does not help. From a later post the OP wanted to recognize all kinds of images without using the extension; for this I have no solution whatsoever. Do you ?
|
|
|
|
|
No, I don't see any way he can automatically find them without *ever* specifying the extensions.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hey All,
Thanks for the suggestions (especially the ToLower one, i would have def. forgotten that one).
I guess it looks like i'm gonna be coding them in myself then. I was thinking along the lines of the windows file search dialog in which you can select the broard reanges of file types. Oh well.
Thanks again.
|
|
|
|
|
i am using picturebox to create visual buttons, but i want the picturebox has tabstop property, how can i do?
|
|
|
|
|
Use a button and set it's image to be the image you want to show.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i am creating button that has some special properties, like zoom, rounded, gradient etc. properties. and also i am creating textbox, checkbox... controls from picturebox, and i want to know how can i catch [tab] key into my new control to focus, any api code?
|
|
|
|
|
The below code just provides the ability to change the password:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<asp:ChangePassword ID="ChangePassword1" runat="server"
CancelButtonType="Button"
ChangePasswordButtonType="Button"
ContinueButtonType="Button"> </asp:ChangePassword>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I want to give the user the capability to make almost a full update of his
personal account details which, besides the password, would also
include First Name, Last Name, Email, Adress, City, Country, Zip and
Phone.
Can it be done by including the “ChangePassword” control or it needs
to be done completely in a programmatic way ?
If so what code should I use ?
( I am using C# and Asp.net 2.0 )
|
|
|
|
|
Hey guys,
I'm trying to check the uniqueness of the index key of visual foxpro tables. From the tableinfo table I read all names of the tables in the database and the name of their index key.
The name, index key and path (omniwinroot) are stored in an instance of class ActiveTable named tableToAnalyze
Next I invoke a member method of ActiveTable (Analyze.Table) on that instance.
This executes 2 queries on the table. The first one counts all the records, last one counts only those with distinct index key.
If there are less unique index keys then there are rows in the table then the UNunique index keys are safed in a queue (so it could be fixed later).
The goal is to copy (by value) tableToAnalyze to a list of instances of ActiveTable when double index keys were found.
So something like this:
<br />
Class classVar = new Class();<br />
list<Class> classList= new List<Class>();<br />
<br />
classVar.integer1 = 1;<br />
classVar.integer2 = 3;<br />
<br />
if (condition) classList.Add(classVar);<br />
From there i could display in a datagridview and prompt the user to repair (only those tables he wants to repair).
The code I have seems to copy by reference. After all the tables are analyzed my list holds 2 (which is correct) of the same values. Both hold the values of the last table
What am i doing wrong?
private void dubbelNummeringToolStripMenuItem_Click(object sender, EventArgs e)<br />
{ <br />
string sqlQueryTableInfo ="SELECT ctableid, flocation, ctablename, caliasname, cidfield, cidindex, cdatabase FROM tableinfo WHERE (cdatabase = 'dpatient') AND (flocation = 'data') AND (cidfield <> '') ORDER BY ctablename";<br />
string connectionStringTableInfo = "Provider=VFPOLEDB.1;" + "Data Source=" + omniwinRoot + "\\tableinfo.dbf";<br />
<br />
OleDbCommand commandTableInfo = new OleDbCommand(sqlQueryTableInfo);<br />
<br />
ActiveTable tableToAnalyze = new ActiveTable();<br />
List<ActiveTable> tableToAnalyzeList = new List<ActiveTable>();<br />
<br />
using (OleDbConnection ConnTableInfo = new OleDbConnection(connectionStringTableInfo))<br />
{<br />
try<br />
{<br />
ConnTableInfo.Open();<br />
commandTableInfo.Connection = ConnTableInfo;<br />
OleDbDataReader readerTableInfo = commandTableInfo.ExecuteReader(CommandBehavior.CloseConnection);<br />
while (readerTableInfo.Read())<br />
{<br />
tableToAnalyze.omniwinRoot = omniwinRoot;<br />
tableToAnalyze.table = readerTableInfo.GetString(3).Trim();<br />
tableToAnalyze.tableKey = readerTableInfo.GetString(4).Trim();<br />
tableToAnalyze.AnalyzeTable();<br />
tableToAnalyze.verschil = tableToAnalyze.tableRecords - tableToAnalyze.tableUniqueRecords;<br />
if (tableToAnalyze.verschil > 0)<br />
{<br />
tableToAnalyzeList.Add(tableToAnalyze);<br />
}<br />
<br />
}<br />
ConnTableInfo.Close();<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message + Environment.NewLine + "While opening tableinfo table an error occured." + Environment.NewLine + "Make sure OmniWin is not running.");<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
<br />
<br />
<br />
<br />
public class ActiveTable<br />
{<br />
public string omniwinRoot;<br />
public string table;<br />
public string tableKey;<br />
public int tableRecords;<br />
public int tableUniqueRecords;<br />
public int verschil;<br />
Queue<string> doubleKey = new Queue<string>();<br />
<br />
public void AnalyzeTable()
{<br />
string connectionStringDpatient = "Provider=VFPOLEDB.1;" + "Data Source=" + omniwinRoot + "\\data\\dpatient.dbc";<br />
string queryNumberRows = "SELECT " + tableKey + " FROM " + table + " WHERE (nversionid = 0) " + "ORDER BY " + tableKey;<br />
string queryDistinctRows = "SELECT DISTINCT " + tableKey + " FROM " + table + " WHERE (nversionid = 0) " + " ORDER BY " + tableKey;<br />
string queryGetNotDistinctId = "SELECT " + tableKey + ", count(*) AS count FROM " + table + " GROUP BY " + tableKey + " HAVING count > 1";<br />
try<br />
{<br />
OleDbConnection ConnDpatient = new OleDbConnection(connectionStringDpatient);<br />
OleDbCommand command = new OleDbCommand(queryNumberRows);<br />
command.Connection = ConnDpatient;<br />
ConnDpatient.Open();<br />
<br />
tableRecords = command.ExecuteNonQuery();<br />
<br />
command.CommandText = queryDistinctRows;<br />
tableUniqueRecords = command.ExecuteNonQuery();<br />
if (tableRecords - tableUniqueRecords > 0)<br />
{<br />
command.CommandText = queryGetNotDistinctId;<br />
try<br />
{<br />
OleDbDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);<br />
while (reader.Read())<br />
{<br />
doubleKey.Enqueue(reader.GetString(0).Trim());<br />
}
|
|
|
|
|
Creating a new instance of the ActiveTable variable should do the trick into your while loop
while (readerTableInfo.Read())
{
tableToAnalyze = new AnalyzeTable();
tableToAnalyze.omniwinRoot = omniwinRoot;
tableToAnalyze.table = readerTableInfo.GetString(3).Trim();
tableToAnalyze.tableKey = readerTableInfo.GetString(4).Trim();
tableToAnalyze.AnalyzeTable();
tableToAnalyze.verschil = tableToAnalyze.tableRecords - tableToAnalyze.tableUniqueRecords;
if (tableToAnalyze.verschil > 0)
{
tableToAnalyzeList.Add(tableToAnalyze);
}
}
|
|
|
|
|
That did the trick indeed.
I thought about it but couldn't understand why this would help.
Still don't, hoping to come across an answer in the coming days.
(studying c# for work)
Anyway, thanks a lot.
|
|
|
|
|
Because you were reassigning the properties of the same instance each time. Thats why you got the same object twice in your list because the object is by reference.
With the modification, you'll create a new instance of the object on each iteration and each object in your list will be different because they point at their own reference.
Hope that help
|
|
|
|
|
Yes, that helped
thanks
|
|
|
|
|
i have two forms ChatManagerForm and ChatWindowForm, and i have a bool variable in ChatManagerForm to indicate that the ChatWindowForm is opened or not.
i want to set this variable to false at ChatWindowForm closing, here i think about two choices.
first: make the variable static,and keep the ChatWindowForm refrence and then
access the variable from the ChatWindowFrom instance.
second: use delegetes and events(pass message from ChatWindowForm to ChatManagerForm).
what is the best, the most practical.
or any other suggestions.
thanks in advance
|
|
|
|
|
|
cant you just use myChatWindowForm.Visible ?
|
|
|
|
|
I would use a delegate and event.
public delegate ChatWindowClosingHandler(object sender, EventArgs args);
public interface IChatWindowManager {
void ChatWindowClosing(object sender, EventArgs args);
}
public partial class ChatManagerForm : Form, IChatFormsManager{
public event ChatWindowClosingHandler OnChatWindowClosing;
public void ChatWindowClosing(object sender, EventArgs args){
}
public ChatManagerForm(){
InitializeComponent();
this.OnChatWindowClosing += new ChatWindowClosingHandler( ChatWindowClosing );
}
}
public partial class ChatWindowForm : Form {
public ChatWindowForm( IChatFormsManager cfm ){
InitializeComponent();
this.FormClosed += new ChatWindowClosingHandler( cfm.ChatWindowClosing );
}
}
I have not had a chance to test the above code but I've used this design pattern many of times. I guess you've gotten three differnet answers to your question. lol. I hope this is helpful.
I'm listening but I only speak GEEK.
|
|
|
|
|
can u plz provide me with the chunk of code for the image
|
|
|
|
|
s_khan_876 wrote: the image
The use of the definite article implies that we know what you are talking about. We don't.
What, exactly, do you want to do? And what part of that are you needing help with?
|
|
|
|
|
...because he's using Cryptography.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
He's posted elsewhere and seems coherent... I think he's just drunk. Can we add an item to the posting guidelines that says if you're too drunk to drive you're too drunk to post?
|
|
|
|
|
Oh, no, we must welcome that posts:
let's say better post than drive when one is such drunk
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hello,
i have a webbrowser control in my c# app. if i click on a link which includes php parameter like
"http://www.mySite.com/myscript.php&var=test" the navigating events fires up.
but when i check e.Url.AbsolutePath only "http://www.mySite.com/myscript.php" is being returned.
how do I get the complete url with all parameters in the navigating event of the webBrowser control?
thanks in advance, Opaknack
|
|
|
|
|
Where can I find a comprehensive explaination of "How to store images in a Resource File and later get these images programatically?" Are there programs available for working with Resource Files? (I am new to this area of C#)
(Code Examples would be very helpful)
Joseph Stanish
|
|
|
|
|
If you are working with Visual Studio 2005 just add a resource file to the project (RESX) and the IDE will let you add whatever resources you need and provide a class to retrieve them for you.
|
|
|
|