TonyX852's Q&A profile
Windows Forms How can i get the current string width in textbox of C#
Hi, i am wondering if i can get the current font size (including height and width) or string width in textbox of C# Or how to make the form or the textbox resizable based on the input text string length I checked the functions, which only include this.Font.GetHeight. There is no functions related to width. Thanks in advance. More generally, You can get this value on any controls. Graphics g = control.CreateGraphics(); int width = (int)g.MeasureString(aString, control.Font).Width; g.dispose(); ...Show All
Visual FoxPro Problem trying to create an Encryption Library
I have followed the example for creating a C# Encryption Libary, but receive numerous errors with regard to no overload method ' ' requires 2 arguments, I have verified that my code is exactly as the example provided by microsoft and found no difference. Has anyone ever tried this code and had problems. Is there any other code to create an encryptoin library in C#. I would appreciate any and all assistance. I am responsible for figuring out how to encrypt the connection string for our web config files in Asp.net page. (we dont' have the .net 2.o framework, we are using Visual Studio 2003 with 1.x framework Thanks Heather Yes if have enc.IV = IV; in my Encryption Class. With the exception of yoru post outlining a ...Show All
Visual Basic anything that resembles Gosub?
Can you make something in a sub that works almost like the gosub command I dont want to make a new sub and call that, cause i use a datareader and different variables in the current sub ( and i also would like to use a gosub command in the printdialog sub) Can you make a sub or fuction in the sub or something Any ideas There's nothing in VB.NET that is an exact replacement for gosub. However, a class is just what you need. You'd turn the local variables you now use into class members... ...Show All
Visual C++ Possible VC++ Compiler error
There is a possible violation of 5.16.3 of C++ 2003 Standart. class ObjectA { //ObjectA(const ObjectA&); public: ObjectA(){} virtual void foo () { printf ("ObjectA\n"); } }; class ObjectB : public ObjectA { public: ObjectB(){} virtual void foo () { printf ("ObjectB\n"); } }; void main () { ObjectA a; ObjectB b; ObjectA * p = true &b : &a; p->foo();//"ObjectB\n" correct! ObjectA& x = true (ObjectA&)b : (ObjectA&)a; x.foo (); //"ObjectB\n" correct! ObjectA& y = true (ObjectB&)b : (ObjectA&)a; y.foo ();//"ObjectA\n" error! ObjectA& z = true b : a; z.foo ();//"ObjectA\n" error! } ...Show All
Windows Forms Event name when form is brought back into focus
Form has been minimised, i then use alt +tab to bring it back into focus. What event name is this. There doesnt appear to be an event name focus. sorry if this is really obvious, is early :) Does anything happen before this event I listen to this event, have a breakpoint as soon as it is called, yet the breakpoint is never reached, an exception happens. whenever the application loses focus then gains it again, this occurs. It says : Cannot access a disposed object named GroupBox. But from what i can tell, the UI on the form doesnt contain a groupbox and shouldnt contain one. ...Show All
Windows Forms how to set the combo into an empty string in a binded textbox
Hello everyone, I would like to know how to set a dropdownlist, which is binded to a datatable, empty, like putting the selectedvalue to -1 (it gives me an error). Thanks in advance. Wy don't you set the SelectedIndex to -1 (According to http://support.microsoft.com/kb/327244/ you may want to set the SelectedIndex twice to -1 to work around a bug). ...Show All
SQL Server AS2K5. Internal error: An unexpected error occurred (file 'pffilestore.cpp', line 3267, function 'PFFileSto:HandleDataPag
I have a simple query, that produce internal server error. Internal error: An unexpected error occurred (file 'pffilestore.cpp', line 3267, function 'PFFileStore::HandleDataPageFault'). WITH MEMBER [Product].[Product].Slicer AS [Product].[Product].&[ 214 ] SELECT ([Date].[Fiscal].[Fiscal Year ].&[ 2005 ]) ON COLUMNS, CROSSJOIN({[Product].[Days to Manufacture].[All Products],[Product].[Days to Manufacture].[All Products].children},{[Measures].[Internet Sales Amount]}) ON ROWS FROM [Adventure Works] WHERE ([Product].[Product].Slicer) Another MDX query produce wrong result. WITH MEMBER [Product].[Product].Slicer AS [Product].[Product].&[ 214 ] SELECT {([Date].[Fiscal].[Fiscal Year ].&[ 20 ...Show All
Visual C# *csv string conversion
I read a *.csv files into a string variable. I then split it into separate lines. My next task seems to convert the string values into values corresponding the elements of an XML file the values are supposed to be written to. This is an example of a line in this csv file: 14-Sep-2006, 6.44, 6.44, 6.3, 6.32, 26300, 6.32 In the XML file which is supposed to be a recipient for this string the column types are defined as: DateTime , float , float , float , float , long , float . I ran into a problem converting the first string into DateTime. Of course, I can do it an awkward way split the date 14-Sept-2006 by delimited "-", etc, etc. Is there a standard built in class or function that can do it Another question pertain ...Show All
Connected Services Framework CSF vs. WCF ("Indigo")
I took a brief look at the architecture of both frameworks and they looks very similar. If a company is looking to do a major implementation over the next few months of CSF, shouldn’t they just wait till WCF is released Are there major differences between the two Hi, At a very high level, WCF provides a way to create individual services (and leverages latest WS* protocols) . CSF provides a way to create and tie the services together to form consolidated services and manage them. CSF3.0 uses WSE3.0 and later version of CSF is probably going to use WCF. Thanks, Ashish Malhotra ...Show All
Microsoft ISV Community Center Forums Change a value for a link to another Excel file
I do not know much about Visual Basic and maybe somebody know how to change the value 100,200,50,75 by a link to another excel document Dim A As Integer Dim B As Integer Dim C As Integer Dim D As Integer A = 100 B = 200 C = 50 D = 75 ActiveSheet.Shapes.AddShape(msoShapeRectangle, A, B, C, D). _ Select Range("B2").Select End Sub Create a workbook called 'Shapedata.xls' and enter values in A1:D1, then insert this code: Dim dataWB As Workbook Set dataWB = Workbooks.Open("c:\documents\shapedata.xls") 'change to correct path A = dataWB.Worksheets("sheet1").Range("a1").Value B = dataWB.Worksheets("sheet1").Range("b1").Value C = dataWB.W ...Show All
Visual Studio Express Editions how can I just load form1 without show him from other form(form2)?
Hi, I have an application that take 6 second to load and then to appear on the screen (in the 6 second you can see the form but he look like stuck and after 6 second it is working properly). I want to do a progress bar while the application is loading. So I thought maybe to make another form(form2) with a progress bar and to load the first form (form1) while the progress bar fill in ( in form2). but I didn't find how can I just load form1 without show him I be glad to hear other ideas if you have Best Regards, Yaniv just don't Show the form. Instantiate it but don't call the Show() method until you are finished with your progress form you are best t ...Show All
Visual C++ How do I compile for Windows 95 using Visual Studio 2005
I have an app that we recently migrated from VS2003.NET to VS2005. It is a standard unmanaged MFC app. It worked under windows 95 before migrating, but fails to load now due to the fact that IsDebuggerPresent() is not available in Kernel32.dll under Windows 95. My code doesn't call this thing. Rather, some aspect of ATL does (we use MFC, which appears to be merged with ATL these days). I found some info in NewAPIs.h which indicates that you can force the compiler to use its wrappers so that your app still runs under 95, but I can't find any way to force ATL/MFC to actually use said headers. If I include newapis.h before including any MFC headers, I get errors regarding missing typedefs. If I include it after, I get errors regarding mult ...Show All
Visual Studio Team System [Urgent Help needed] VSTS unable to log into ADFS!
Hi All, First of all, here is what the performance rig is like 1) Two webservers in clustered environment on a subnet. 2) One ADFS server in the same subnet as the webservers for authentication. 3) One DB server on the same subnet. When user navigates to the http://webserver/ they are redirected to the http://ADFS/ machine which would display the user a page where he/she would choose their federation server, once they choose their federation server this page would place a cookie and would not be displayed next time user is redirected for authentication. After choosing the fedration server user is presented with a login page which is hosted on the ADFS box, user would put their CORRECT user name and password ...Show All
Software Development for Windows Vista Pseudo Code anyone?
Ok Experts, I am looking for nothing more than pseudo code at this point - I've done little more than dabble around with the UI, created a simple activity, done some limited persistence etc.. Here's what I would like to do: Create a new WF instance Persist, and place the Instance GUID in a table, along with other attributes Present this list and allow selection Open the WF Instance again, and munge around with it - add properties etc.. Continue along the WF route and evaluate rules as necessary Persist again, etc.... Essentially I am not seeing the easy way to open a WF instance, work on something related to it, then update some properties and have it reume it's path ... Anyone care to point me in the right ...Show All
.NET Development Can xsd.exe use a type from another schema?
I have a schema that I'd like to split into two pieces; one in the existing project, and one in a new project: "New" part: < xs:schema id = " SchemaValidation " targetNamespace = " urn:schemavalidation " xmlns:tns = " urn:schemavalidation " xmlns:xs = " http://www.w3.org/2001/XMLSchema " > < xs:complexType name = " SchemaIssues " > ... </ xs:complexType > < xs:element name = " SchemaIssues " type = "tns :SchemaIssues " /> etc. "Old" part: < xs:schema xmlns:xs = " http://www.w3.org/2001/XMLSchema " xmlns:tns = " urn:faults " xmlns:val = " urn:schemava ...Show All
