|
i'll try to help with simple solution
1. create user control contains your groupbox
2. in the form designer, place that user control in your tab
3. if the specific button you mention before clicked, add new tab, create new instance of user control described above, place that control in your new tab
4. if you don't understand what i talk about you must :
- understand what is OOP
- understand how to create and place control in parent control at runtime
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
You can't actually have a reference, a control can only be in one place at a time, so you've got no problem there.
Like people have said, you will need to create a new instance of the controls and add these new controls to the tab.
To see how you can create, setup, and add controls, just check the designers generated code.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Guys i m having access database connected in windows application
and i want to sort a table in that by the values in last column(4th) in ascending when some1 clicks on sort button
any idea??
|
|
|
|
|
You have a database, run SQL against it that sorts your data.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
u can create dataview from ur dataset and can sort the data runtime.
rahul
|
|
|
|
|
if u want it handled by database server, use requery, otherwise if u want it handled by your aplication use DataView
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Hi
i am creating log file and started to add New line
i user stream write class
<br />
StreamWriter objWriter = new StreamWriter(path);<br />
if (!File.Exists(path))<br />
File.Create(path);<br />
objWriter.WriteLine("[" + DateTime.Now.ToString() + "] "+ Header + Message);<br />
<br />
objWriter.Close();<br />
when i compile the program and it start maintaining the Log and after closing the Programme i check the log file there is one one line written which the last activity that i logged.
wasim khan
|
|
|
|
|
WriteLine should do it, although I am confused how this code works in general. I doubt that the if (!File.Exists code ever runs.
Environment.NewLine is how you write a new line.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
What you want to do is to open the file for append. Instead of letting the StreamWriter create the FileStream , open the FileStream yourself so that you can use FileMode.Append when you open it.
If you want to check if the file exists, you have to do that before opening it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi i got the answere
<br />
StreamWriter objWriter = new StreamWriter(path,true);<br />
StreamWriter Contructor pass two parameter
so the path specify the File and "true" means to append the File
wasim khan
|
|
|
|
|
It's overall simpler to use File.AppendText, File.WriteAllText, etc.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
I am with a C#.net Inventory application in one of my form there is a datetimepicker whose value my change according to some selections how can I set the datetimpicker value back to current datetime on a buttion click. I put like datetimepicker1.Text=DateTime.Now.Date.ToString(); but its text is not getting the current datetime
Thanks In advance
Regarda
Anu Palavila
Thanks & Regards
|
|
|
|
|
|
dateTimePicker1.Value = DateTime.Now.AddHours(-24);
and 24*265 hours will be equal to one year
|
|
|
|
|
dateTimePicker1.Value = DateTime.Now.AddHours(-24);
and 24*365 hours will be equal to one year
|
|
|
|
|
ali zaidi wrote: and 24*365 hours will be equal to one year
No.....
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi,
Try
dateTimePicker1.Value = DateTime.Now.Date; . If this is not working, check whether there is any other event that is getting fired.
Hope this helps,
|
|
|
|
|
I have created a window application in c# and Sqlserver 2005.
Now on my server the connection string is working properly, but on client machine my databse is not conecting.
my connection string is :
server=192.168.1.88;Data Source=NZN-7FC996E32D7\SQLEXPRESS;Database=HungerLine;Integrated Security=true
|
|
|
|
|
And is the client on the same network as you, so they can see that IP address and it points to the same machine as it does on your server ?
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
//Insert record into database
conn.Open();
int iResults = cmd.ExecuteScalar();
conn.Close();
if (iResults == 1)
{
}
//The user record was found in the Database
else
{
//The user record was not found in the Database
}
When i debug, there's an error message saying "Cannot implicitly convert type 'object' to 'int'. An explicit conversion exists(are you missing a cast?)
|
|
|
|
|
> "Cannot implicitly convert type 'object' to 'int'
You can't.
> An explicit conversion exists
It does.
> are you missing a cast?
You are.
It goes here: int iResults = (int)cmd.ExecuteScalar();
|
|
|
|
|
I recommend reading the article I link to in my sig, it will explain exactly how to solve these sort of error messages.
And, it's better to use int.TryParse and the ToString method, in general, b/c your code otherwise assumes that the value can be cast to int.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi,
I have a native dll that I am interfacing through P/Invoke. I have created the API, but have no way to debug the native code. I tried using windbg for this, but couldn't figure out how. So, my current alternative is to have the native code print to stdout/stderr using fprintf. However, I can't find any way to see this output in C#. Is there a way to capture stdout/stderr output from the native code?
klk
madness ? this.isSparta = true : this.isSparta = false;
|
|
|
|
|
Hi,
what I tend to do in such case is I pass a managed delegate that takes a string and logs it somehow;
the unmanaged side accepts it as a pointer to a function that takes one char* as a parameter.
Each time I want to log some native thing, I call the function pointer, and the managed world
logs it (together with, and in sync with, the managed logging).
Hence no capturing stdout/stderr, just passing a delegate.
|
|
|
|
|
Hi Luc,
I did what you said, and got it to work - so now I can get debugging output sent to the console. Thanks!
It still feels like the old "printf" cycle of debugging (bug -> add printf -> recompile -> pray). Are there any guides on using WinDbg or another debugger to debug code that crosses managed->unmanaged boundaries?
klk
madness ? this.isSparta = true : this.isSparta = false;
|
|
|
|