|
In Visual Studio, add a Setup project. Click on the setup project's file system editor. Right-click, add special folder-> users start menu. There, add a shortcut to the uninstaller.
|
|
|
|
|
I am trying to create a TabPage as separate object. I can edit them iside s tab control allright, however, I can't create or edit the control layout of a separate TabPage.
When I create a user control (or a form), and change the base class to "TabPage", the editor changes to a generic controll collection.
What can I do?
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
I don't think there is a Visual Studio designer that allows you to layout tab pages visually. If you really need this, I think you're going to have to create your layout as a custom control, then add that to the tab page at design time.
|
|
|
|
|
This actually was easier than I thought - thanks!
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
WHEN I WRITE CODE, visual studio.net unexpectactly closes, and restart itself, i get the following errors.
OSK.EXE title
System Failed to initialize
and the second Error is VCSPAWN.EXE TITLE
APPLICATION FAILED TO INITIALIZE
I HAD A CODE THAT CONNECT TO SQL7 DB, IT CONNECT VERY WELL AND DISPLAY THE CONTENTS OF MY TABLE, BUT AFTER THAT IT ATTEMPT TO SHUTDOWN. I HAVE SCREEN SHOTS OF THE OCCURANCE, BUT I DONT SEE AN OPTION TO ATTACH IN HERE SO YOU CAN SEE, PLEASE PROVIDE ME WITH YOU E-MAIL I WILL ATTACH IT. THANKS
NOTE:THIS HAPPEN AFTER I FORMAT THE PARTITION, AND I FIRST INSTALL VISUAL STUDIO 2003.
PLEASE HELP
Vuyiswa
|
|
|
|
|
WRITING IN ALL CAPS IS JUST ANNOYING AND WONT MAKE ANYONE HELP!
*ahem*
Anyway did you bother searching? It takes less time to open up google and search for something than it does to post on here ...
http://www.google.co.uk/search?hl=en&q=vcspawn.exe&meta=[^]
Now repeat after me: "I will always search before posting multiple times in a forum and in caps"
Edit: spelling X(
|
|
|
|
|
I was searching for how windows detect MMC or SD or Flash disk and bring up a dialog that gives you options to open folder or in windows media player..etc. ...
I want to build application that make the same...
I had made an application that detect any change in disks generally but for example ( I'm intereted in MMC ) my application can detect the memory reader when it's plugged or unplugged but when I insert a memory stick in the reader it doesnot detect any change ...should I make timer that watch the memory reader all the time!! I think it's not good way..so any one has any solution for this??? and this dialog that windows brings up is from shell32.dll so any one knows how to know the function and its parameters??
thanks in advance
|
|
|
|
|
|
Ok I you create a new C# windows project and then create a ".settings" with an item (string) and (user) as the type. Now this will create an app.config file associated with the project. Go into the properties for the app.config and change the Build Action to (Embedded Resource). Now in your windows form create and edit box and a button which loads and saves the setting that your created.
Build the project. Go into the bin folder and click on the exe file to run the project. Try changing the settings and saving the settings. Close the project and load it back up by clicking on the exe file to verify that the save works which it will.
BUT WHERE DOES IT SAVE TOO??????????
I cant figure it out......
Chris
|
|
|
|
|
Hi,
It saves it somewhere in C:\Documents and settings\UserName\LocalSettings\Application Data \Your Application Name .Exe XXXXXXXXXXXXXXXXXXXXXXXXXXX\VersionNumber\user.config
Try search *.config in your documents and settings and u will find it.
That's because .Net wants to save Config settings for each Windows user. so it does not touch the application.config file that can be shared between many users.
That happens even u don't set the Build action to Embedded Resource wich is not logic because the config file must not be embedded in the exe.
HTH.
Hayder Marzouk
|
|
|
|
|
|
Hi, I am just beginner in .NET with C#. In my study, I have learned that when an instance of a class created in the heap is not owned by reference (a variable of that class) , the Garbage Collector (GC) removes this instance from the memory after a while. In my first small application in .NET, I hasitate in a point that When I am testing a click event of a button control of my Form1 class, I declared a variable of type a Form class (let's say Form2). The View is like this:
private void button1_click(....)
{
Form2 myForm2 = new Form2();
myForm2.Show();
}
Here when the execution gets out of the click event, then I expect that the local "myForm2" becomes out of scope for availibility. But my new form (Form2) still apears on my screen. Why? Cause no availiable reference to this Form2 instance anymore, immediately after the button click event routine. Anything I need to know more about "scopes" and GC ?
|
|
|
|
|
As u have created reference of form2 from form1's button click event so this reference of form2 will remain in scope till the form1 is in scope and as soon u will close the form1 the reference of form2 will also be lost and GC will reclaim the memory back and will close the form2 also.
rahul
|
|
|
|
|
First, I'd really like to thanks to you rah_sin for your answer..
I need one more point: What you explain is valid for only class of Form or those inherited from Form class? Cause as you hv seen in my example the refernce "myForm2" is not a direct member of Form1 class but a local declaration in button click event. Or should I understand that Show() method of Form class, saves or register its reference into a global collection internally or somewhere in caller form ?
In other words, what if my locally declared variable was of simple class like:
class Sample
{
private string sName;
private int nIdNumber;
public Sample()
{
//...
}
public string Name
{
get {...}
set {...}
}
//...
}
private button_click(....)
{
Sample mySample = new Sample();
mySample.Name = "Testing Name";
}
|
|
|
|
|
Hi!
I'm using a dataGridView (dgv) bound to dataSet through bindingSource.
one method (fired by button.click) fills the dataSet using dataAdapter.
the dgv displays loaded rows.
now what my goal is: when a row is displayed additional data for it is loaded in a background thread, and the row is refreshed (i'm using grid's overriden paint event to display the additional data) the reason for this is that I want to get and display the additional data only if the row is ever displayed, to avoid downloading (from sqldb) data that is not needed..
my current solution is:
<br />
public void GetPricesForRow(DataGridViewRow row) {<br />
if(backgroundThread != null)<br />
while(backgroundThread.ThreadState == System.Threading.ThreadState.Running)<br />
Thread.Sleep(3);<br />
<br />
backgroundThread = new Thread(new ThreadStart(delegate() {<br />
try {<br />
int colCt = row.DataGridView.Columns.Count;<br />
<br />
string[] vals = GetAdditionalData(row.Cells[1].Value.ToString().Trim());<br />
row.Cells[colCt - 2].Value = vals[0];<br />
row.Cells[colCt - 1].Value = vals[1];<br />
row.Refresh();<br />
} catch { }<br />
}));<br />
<br />
backgroundThread.Start();<br />
}<br />
row.Refresh(); fires:
<br />
public void Refresh() {<br />
this.DataGridView.InvalidateRow(this.Index);<br />
} <br />
well it works.. but pretty slow.. when i set backgroundThread.IsBackground to true the row doesn't refresh (at least not always)
anybody knows a better solution?
life is study!!!
|
|
|
|
|
Hi,
Use VirtualMode option of the datagridview. U can find examples in the MSDN
HTH.
Hayder Marzouk
|
|
|
|
|
ok. i got it..
<br />
public bool GetPricesForRow(DataGridViewRow row) {<br />
ManualResetEvent doneEvent = new ManualResetEvent(false);<br />
PricesForRow pfr = new PricesForRow(row.Cells[1].Value.ToString().Trim(), doneEvent);<br />
<br />
bool x = ThreadPool.QueueUserWorkItem(pfr.ThreadPoolCallback);<br />
WaitHandle.WaitAll(new WaitHandle[] { doneEvent });<br />
int colCt = row.DataGridView.Columns.Count;<br />
row.Cells[colCt - 2].Value = pfr.OutBold;<br />
row.Cells[colCt - 1].Value = pfr.OutNormal;<br />
row.Refresh();<br />
<br />
return x;<br />
}<br />
and an additional class:
<br />
class PricesForRow {<br />
ManualResetEvent _doneEvent;<br />
string _param;<br />
<br />
string _outBold;<br />
public string OutBold {<br />
get { return _outBold; }<br />
set { _outBold = value; }<br />
}<br />
<br />
string _outNormal;<br />
public string OutNormal {<br />
get { return _outNormal; }<br />
set { _outNormal = value; }<br />
}<br />
<br />
public PricesForRow(string param, ManualResetEvent doneEvent) {<br />
_param = param;<br />
_doneEvent = doneEvent; <br />
}<br />
<br />
public void ThreadPoolCallback(Object threadContext) {<br />
try { <br />
string[] vals = DataBase.Instance.GetKtmsPrices(_param);<br />
_outBold = vals[0];<br />
_outNormal = vals[1];<br />
_doneEvent.Set();<br />
} catch { }<br />
}<br />
}<br />
this works just fine!! doesn't slowdown the grid or anything..
life is study!!!
|
|
|
|
|
well once again i am posting the question with bit more elaboration.I need to create MS project file using "MS Project Object Modal 11.0" within C# .All examples ,that I searched on internet, were written in VB.Net .I wonder if this could not be done in C# ... I am not getting any documentation on msdn either about Microsoft.Office.Interop.MSProject namespace .Is there any need to install MS Project 2003 SDK as well ???
Regards,
LinkinP
|
|
|
|
|
Hello, I need to use an unmanaged dll written in c in a program written in c#.
This dll uses linked list and I use PInvoke in my c# code.
Dll code:
typedef struct payload{
char name[NAME_SIZE];
int release;
char info[INFO_SIZE]; //this info is related to the type of msg: {app url, log url, command-line arguments}
payload *next;
}payload;
C# Code:
[StructLayout(LayoutKind.Sequential)]
public struct payload
{
public string name;
public int release;
public string info;
ref payload next; //Compiler error
}
I can't make it work because the compiler prompts me an error for the pointer in the struct, any suggestions?
|
|
|
|
|
what is the error, it might need a sizeof check out in the api
|
|
|
|
|
mephy83 wrote: [StructLayout(LayoutKind.Sequential)]
public struct payload
{
public string name;
public int release;
public string info;
ref payload next; //Compiler error
}
Use IntPtr for the pointer to the next structure:
[StructLayout(LayoutKind.Sequential)]
public struct payload
{
public string name;
public int release;
public string info;
public IntPtr next;
}
Check this reference[^] for more details. Specifically, look at the "MYPERSON2" example.
|
|
|
|
|
I want to use an enum of strings in my program, but as I found out, the default underlying type for enums is int
So how do you set the underlying type of an enum to string??
Thanks.
|
|
|
|
|
|
I guess I'll use string constants instead...
|
|
|
|
|
Depending on what your trying to solve it may be best. Enums were introduced to give meaning to magic numbers, it allows you to work with a meaningful name rather than some meaningless number.
|
|
|
|