|
When the main window of a .NET Windows Forms app is partially occluded by other windows, clicking one of the app's exposed menu items correctly activates the form but doesn't display the menu.
I know this is in keeping with MS' new UI guidelines (as seen in Office 2003 apps), but I'd like my app to behave like an older style MFC app. I recall seeing an article/note that explained how to do this but don't seem to be able to find it. A pointer would be much appreciated.
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hi everybody!
I have DataGridView whose sourse I set to a datatable with 4 columns
containing data. I then remove two columns, create a DataGridViewComboBoxColumn and DataGridViewCheckBoxColumn and insert this into the same location as the columns that were removed. I want to set as the selected value in the combo box of every cell in the DataGridView a specific value. I have done it, but once the debugger leaves the file with the code that executes this functionality, the values that were set in the combo box and check box are lost.
I don't know whether the problem is because I removed and then added these columns. At the end of the Load() method I have this line: dataGridView.AutoGenerateColumns = false; if I don't use it, the column that I removed appears again. Any idea about why the value of the DataGridComboBoxColumn is changed to null automatically and how to solve it?
Other thing is that if I change the values of the combo box in the datagridview and later I want to save them, when I get the values are not the ones I chose, but the values that I set at the beginning as the datasource of the datagridview.
This is part of the code I’m using:
private void FrmTestCases_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Path", typeof(string)));
dt.Columns.Add(new DataColumn("Category", typeof(string)));
dt.Columns.Add(new DataColumn("Include", typeof(string)));
dt.Columns.Add(new DataColumn("Description", typeof(string)));
dataGridView.DataSource = dt;
dataGridView.Columns.Remove("Category");
dataGridView.Columns.Remove("Include");
DataGridViewComboBoxColumn cb = new DataGridViewComboBoxColumn();
DataGridViewCheckBoxColumn kb = new DataGridViewCheckBoxColumn();
cb = CreateComboBoxColumn("Category", "Category");
kb = CreateCheckBoxColumn("Include", "Include");
dataGridView.Columns.Insert(1, cb);
dataGridView.Columns.Insert(2, kb);
}
// ---------
private void OnFormClosing(object sender, FormClosingEventArgs e)
{
DataRowView testCase = (DataRowView)dataGridView.Rows[0].DataBoundItem;
String fileStream = testCase["Include"] + "," + testCase["Category"];
}
I've been working on it for days but NO LUCK !! Can you please give me a hand?!
Elvia
|
|
|
|
|
Hi, I was wondering how to make the unvisible btnClose visible when btnOpen is Clicked, then hide btnOpen when btnClose is Clicked, so it is kind of like a loop. Feel free to email me
|
|
|
|
|
btnClose.Show();
btnOpen.Hide();
etc.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
void btnOpen_Click(object sender, System.EventArgs e)
{
btnOpen.Visible = false;
btnClose.Visible = true;
}
void btnClose_Click(object sender, System.EventArgs e)
{
btnOpen.Visible = true;
btnClose.Visible = false;
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
I have solution with almost 100 projects. I have one startup project. Everytime if there is any changes in one of the projects i am pressing F5 to build all the projects, which is taking about 30-40 mins. And i don't have provision to uncheck the Build check box in configuration manager of solution, its locked.
Is there any way i can test and debug just the changes made. I tried Attach to process. From bin folder i executed the exe of startup project and try to attach one of the changed projects from solution (which is other than start-up), sometimes it is attaching and sometimes not. Even if it attaches i am unable to debug the changes made.
I am using Framework 1.1
Any help, Very urgent
Thanks
Santosh
|
|
|
|
|
First off, you can try to enable the Incremental Build feature of studio to prevent those long build times. I am assuming you're using VS 2003: go into your Project Properties->Configuration Properties->Adavanced and enable (set to true) the Incremental Build (you can read more about this feature in on-line help).
Attach to process works, provided the EXE and the code are insynch with one another; in other words, if you make too many changes to the the code, and attempt to attach to that running process, despite the fact that you have break-point set, it maynot allow that breakpoint to execute.
If you just want to rebuild out one of the sub-projects, you can right-click on that project in solution explorer, and click Rebuild; it should only rebuild that project and anything the changes made will effect ...
Good-luck!
:..::. Douglas H. Troy ::..
Bad Astronomy |Development Blogging|Viksoe.dk's Site
|
|
|
|
|
Is there a way to clear the history of a webbrowser? I have a winform that uses a webbrowser, but when I go from one process to another I'd like its history to be cleared so that the back button goes no further than the current process's first page.
|
|
|
|
|
FoxholeWilly wrote: back button goes no further than the current process's first page
The back button history is persistent across processes? Can someone confirm this? It sure doesn't work that way in IE or Firefox browser desktop instances.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
You assume too much with the word "process." I am using it in its generic form. I have a webbrowser, a user pushes a button, and it displays some content, then does something completely different, then pushes a button, and other content is displayed in the webbrowser. I would like to clear the navigation history so that when the user pushes "back" he does not go beyond the initial page from the second time the webbrowser was used.
|
|
|
|
|
FoxholeWilly wrote: You assume too much with the word "process."
Yeah sorry about that.
I got your original reply by email. I can understand how you thought that.
I have used WebBrowser in applications where I create new instances of it during the lifetime of the application (process). I thought you were meaning that and the history was still present across the different instances. I was interested since it would effect the behavior of my applications.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Sorry about the original reply, it was one of those stupid and impulsive messages that one regrets the moment the "Post" key is pushed.
I figured I would have to just dispose and recreate the webbrowser control each time, but was hoping there was a simple yet illusive command that would clear the history, something like WebBrowser.ClearHistory() (hint, hint, Microsoft)
|
|
|
|
|
in your html page put the following
history.forward
this vil work good
regards
kalyan
|
|
|
|
|
I'm trying to get javascript to work from within a js file which is embedded into a custom control. I am able to get embedded style sheets and images in the same control to work fine. I have used reflector to verify that the .js file is there and has the correct path. I have tried three methods of referencing the js file in my OnPreRender method. I have used RegisterClientScriptInclude in conjunction with GetWebResourceUrl. I have used RegisterClientScriptResource. I have tried just setting up a LiteralControl with the script reference and adding it to the header, using GetWebResourceUrl to get the URL. In all these cases, the script tag is rendered on the page with a url that looks like this:
<script src="/control_test/WebResource.axd?d=kN16ZCatkm1MQ5JqEow-rFnxOlL1FcRrnlZIuw4pdq5WQtMe1QPxJ5N0g5Bj_QiVljlpuyQ3oGq1EsHpF2JdEw2&t=632826839637949892" type="text/javascript"></script>
but when I try to call a function from the file, I get an 'object expected' error. If I put http://localhost plus the url listed in the script tag into my browser, it returns a file called WebResource.axd which has the contents of the javascript file. It seems like if that is happening, then the browser should have access to the file. Could this be some type of mime type problem? I have the mime type in my AssemblyInfo.cs as text/javascript.
Jason
|
|
|
|
|
Nevermind. The javascript is actually loading, it's some other problem.
|
|
|
|
|
Hi, i wanna allocate memory for some data but i dont know how.
With C it loks like
struct MyStruct
{
int number;
string Name;
struct *Next;
}
But i dont know how do that in C#
so could some one help me.
??
thx
|
|
|
|
|
In C# you don't allocate blocks of memory directly. The common language runtime that runs your code handles memory allocation and memory cleanup automatically for you. So instead of malloc, you allocate objects using the new keyword.
MyFoo obj = new MyFoo();
If you're absolutely certain that you need to allocate a block of memory (the only real scenario for this would be interoping with native code), then you can use System.Runtime.InteropServices.Marshal.AllocHGlobal or some of the other interop classes inside the InteropServices namespace.
Does that answer your question?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
but how can i point to the next instance of myFoo.
So if i have to creat 3 data.
i explain, the pointer first points to the beginning of my struct
so i wanna write some think like
first->Next=Second; and so on Seond->Next=Third.
So!!
-- modified at 12:49 Monday 8th May, 2006
|
|
|
|
|
Oh, so you're trying to do a linked list. I see.
You can do that like so:
class MyClass
{
public MyClass Next;
}
MyClass instance1 = new MyClass();
instance1.Next = new MyClass();
instance1.Next.Next = new MyClass();
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
|
ok i ll; try to do it
but one other rquestion,
how cans i store the other data which are int Numer and string name;
does it look like
class Myclass
{
int number;
string name;
public Myclass Next;
}
|
|
|
|
|
torNAdE wrote:
does it look like
class Myclass
{
int number;
string name;
public Myclass Next;
}
Yes.
As a general recommendation, class fields should be private. If you need to access them outside of the class, use a property:
class MyClass
{
private int number;
public int TheNumber
{
get
{
return number;
}
}
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
thank you verry much.
it was helpfull
|
|
|
|
|
I have solution with almost 100 projects. I have one startup project. Everytime if there is any changes in one of the projects i am pressing F5 to build all the projects, which is taking about 30-40 mins. And i don't have provision to uncheck the Build check box in configuration manager of solution, its locked.
Is there any way i can test and debug just the changes made. I tried Attach to process. From bin folder i executed the exe of startup project and try to attach one of the changed projects from solution (which is other than start-up), sometimes it is attaching and sometimes not. Even if it attaches i am unable to debug the changes made.
I am using Framework 1.1
Any help, Very urgent
Thanks
Santosh
|
|
|
|
|
I believe Visual Studio will rebuild any projects that have dependencies on the project you've just modified. So if you modify A, yet B and C depend on A, B and C will be rebuilt as well.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|