I anage to find out how to do this... open the form like this: frm_ManualRotary frm = new frm_ManualRotary(); frm.Dock = DockStyle.None; frm.FormBorderStyle = FormBorderStyle.None; frm.AutoScroll = true; frm.ShowDialog(); in Load form event I handling the folowing events: textBox1.LostFocus += new EventHandler(textBox1_LostFocus); SIP.EnabledChanged += new EventHandler(SIP_EnabledChanged); And finaly the event handlers void SIP_EnabledChanged(object sender, EventArgs e) { if (SIP.Enabled) this.Height = 268 - SIP.Bounds.Height; //268 = Total height of my screen. else this.Height = 268; } void textBox1_LostFocus(object sender, EventArgs e) { //When leaving text box hide SIP SIP.Enabled = false; } void textBox1_GotFocus(object sender, EventArgs e) { //When entering text box, show SIP and autoscroll so textbox is above SIP. SIP.Enabled = true; this.AutoScrollPosition = new Point (Math.Abs(this.AutoScrollPosition.X), textBox1.Top + textBox1.Height); }
Ola E
Posts
-
"Keybord" hide my form... -
"Keybord" hide my form...Hi, Can someone tell me how to resize my form, when the keybord is pressent? I have tried to do it like this: I have added the input control to my application and named it SIP I have added the event on load form... SIP.EnabledChanged += new EventHandler(SIP_EnabledChanged); void SIP_EnabledChanged(object sender, EventArgs e) { if (SIP.Enabled) { this.Height = 268 - SIP.Bounds.Height; this.AutoScroll = true; textBox1.Text = this.Height.ToString() + ", " + SIP.Bounds.Height.ToString(); } else this.Height = 268; } I can se the "268, 80" in my textbox1, so the event is fired, so the form is not resized. Do anyone know how to do this??
-
Access Control from another formThanks, that helped alot. It works as I wanted it to. But I did take youre advice and moved the serial port control to a "ordanary class", witch in terms the two forms can use. Thanks Ola
-
Access Control from another formThanks for the advice but unfourtanly I'm not using VB.Net. I'm writing in c#...
-
Access Control from another formI'm writing a kind of terminal program that uses the serial port. I have it on my "main form", which does most of the communication. My problem is that I need to add another form that also uses the serie port. Now to my question / problem. How can I access the opened serial port on my main form? //Ola
-
Create an Excel sheet from compact frameworkI need to create a Excel Sheet from a cf application. I'm doing a "mobile version" of an PC program, and the result is sent to a server processing the data, so a csv file is not good enougth. Since pocet Excel don't have any API like the "PC version" has, I cant do it in the same way as I have in my PC program. Bacicly I have a DataGrid, that I need to dump to a excel file. Does anyone have an idea on how to do it? Same link to the big mysterius MSDN, that I havent found...? Or perhaps someone know that there is'nt any good way to do it? Myabe someone knows about the file spec for an Excel file, so I can write my own "ExcelWriter"?? Thanksfull for any answer...
-
how do I add a IMessageFilter to catch mouse down event [modified]According to a lot of places mouse down and other event's are not supported ny .net compact framework. I have looked for the mouse down event in my visual studio 2008, and it's simple not there. I have found several links to msdn forums stating that this is one of the things not implemented in the comapct framework.
-
how do I add a IMessageFilter to catch mouse down event [modified]I'm trying to catch the mouse down and up event and add them to a button control. I'm planing to use IMessageFilter to add the missing events. Now to my problem, It seems like application.addfilter don't exist's in cf... Do anyone have a clue on how to catch mouse events in cf?? Or perhaps i'm looking in the wrong direction? Is there a better way to do this?? Thanks Ola
modified on Tuesday, December 9, 2008 12:39 AM
-
how to use IMessageFilter in cfI'm trying to catch the mouse down and up event and add them to a button control. I'm planing to use IMessageFilter to add the missing events. Now to my problem, It seems like application.addfilter don't exist's in cf... Do anyone have a clue on how to catch mouse events in cf?? Or perhaps i'm looking in the wrong direction? Is there a better way to do this?? Thanks Ola
-
CF button down eventI'm new to .net, and espacially to CF. I need to have a mouse down event (or simmular). The problem is that there dosen't exist one in CF (It does in the "full" .net version). I have read serveral pages saying that i need to create my own button form the existing one and add the missing event's. Can anyone tell me how to do this, or point me to an artcle describing the prosess? Thanksfull for all help I can get! Regards Ola
-
How do I find a XML element based on attributeI don't follow you here... Can you give me an example of how to write that in C#? Thanks!:confused:
-
How do I find a XML element based on attributeI'm new to XML, but wat I'm trying to do is this. I have a XML file with config settings and language items e.g. com1 9600 I read the Config elements by using GetElementByTagName, so this is no problem. I'm looking for a simmular way of selecting the language items so I can do somthing like psedu code Lang = XMLSetup.GetElementsByTagName("Language")[0]; XmlElement LangText= (XmlElement)Setup; textbox.text=LangText.GetElementByAttribute("No","1000").GetAttribute("Text") The last line selects the "value on an attribute, depending on an other attribute" Could this be done? If I change the structure of of my XML file to somthing like... ... Hello world could it be done then?? Any ideas on how to format the XML and do the selection? I'm used to work with databases, and XML could be used as a databse, or??? If you use an SQL table, you can simply do "select Text from Language where No="1000"... Thanksfull for any advice:confused:
-
Veryfy user and password agains a windows accountI'm writing an windows service, which accept connections via a TCP/IP socket. I want to verify the connectin users against windows accounts on the local machine. Do anyone know if there are somthing in .net to do this?? I have looked in System.Security.Principal, but all I could find was "current loged on user", which is not much of help. I would like to have somthing where I pass a username and password and get "accept / denied" or perhaps a usergroup or simular back. Ola Ericsson