Thank you for helping. My impression is that Microsoft deprecated the ability to encode drop-down menu commands into user-recorded macros in Word for Mac 2016. This would explain my inability to record page margin changes into a macro in the 2016 version and would also explain why my 2011 macro code is not getting hold of the PageSetup object in the 2016 version. Word for Mac 2016 does include a new drop-down menu option that achieves nearly the same margin adjustments, so I'll just use that one for now. You assistance is much appreciated.
I got a UserControl called "Card"; on a page I will have up to a hundred Cards, named as Card0, Card1, etc. and I cannot access their properties or controls because Findcontrol does not work for Usercontrol.
BTW, here is my code:
' the following three lines return NOTHING
Dim one_card as UserControl = FindControl("Card0")
Dim one_card as Card = FindControl("Card0")
Dim one_card as Control = FindControl("Card0")
I also tried Page.Findcontrol.
What am I doing wrong? Are there any workarounds? Thanks.
For my user controls on "my machine" (er...asp.net...) yes. The questions I've asked are an attempt to drag sufficient information out of you so that someone can actually help. "Points"...it's not like I can convert those 2 rep points into cash!
As I can't tell clearly here where you are trying to call FindControl from, I would suggest that you aren't doing this from your MasterPage, so you might want to try Master.FindControl("Card0") to find this control on the master page.
I added a
DataGridViewCheckBoxColumn to My Data Grid
Dim DesChkBox AsNew DataGridViewCheckBoxColumn
DesChkBox.Name = "chbSelect"
DesChkBox.HeaderText = "Select"
DesChkBox.TrueValue = True
DesChkBox.FalseValue = False
DesChkBox.Width = 50
grdView.ReadOnly = False
grdView.AutoGenerateColumns = False
grdView.RowHeadersWidth = 5And through a procedure I want to check the Check Box programmatically.
grdView.Rows(0).Cells(3).Value = TrueCatch ex As Exception
The Check Box isnot Checking. Please help me.
I have an application in vb.net 2013 , Entity Framework 6 and SQL server 200R2.
I' have finished the Program , but on the client computer , my program use a text based file called MyProg.exe.config , where are several lines .
But I don't like this text file because it's easily modifiable , and someone can change and the result may be a not working program.
Is there any way to not use ths file , and to save the data for example to a binary file that can be modified only from inside my program ?
The actual MyProg.exe.config has this contents :
<?xmlversion="1.0"encoding="utf-8"?><configuration><configSections><sectionname="entityFramework"type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=18.104.22.168, Culture=neutral, PublicKeyToken=b77a5c561934e089"requirePermission="false"/><!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections><system.diagnostics><sources><!-- This section defines the logging configuration for My.Application.Log --><sourcename="DefaultSource"switchName="DefaultSwitch"><listeners><addname="FileLog"/><!-- Uncomment the below section to write to the Application Event Log --><!--<add name="EventLog"/>--></listeners></source></sources><switches><addname="DefaultSwitch"value="Information"/></switches><sharedListeners><addname="FileLog"type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"initializeData="FileLogWriter"/><!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log --><!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> --></sharedListeners></system.diagnostics><startup><supportedRuntimeversion="v4.0"sku=".NETFramework,Version=v4.0"/></startup><entityFramework><defaultConnectionFactorytype="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"><parameters><parametervalue="v11.0"/></parameters></defaultConnectionFactory><providers><providerinvariantName="System.Data.SqlClient"type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/></providers></entityFramework><connectionStrings><addname="MyEntities"connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=USER-PC;initial catalog=DB1;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework""providerName="System.Data.EntityClient"/><addname="MyEntities2"connectionString="metadata=res://*/Model2.csdl|res://*/Model2.ssdl|res://*/Model2.msl;provider=System.Data.SqlClient;provider connection string="data source=User-PC;initial catalog=DB2;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework""providerName="System.Data.EntityClient"/></connectionStrings><runtime><assemblyBindingxmlns="urn:schemas-microsoft-com:asm.v1"><probingprivatePath="Object"/></assemblyBinding></runtime></configuration>
No, not realy. All of the built in configuration stuff expects the file to be there and in the format it is now.
But first, the Program Files folder, and everything under it, is ReadOnly to normal users. If everyone has admin permissions to their machines (really stupid idea!) then all you're doing is trying to protect the customer from themselves and that's a battle you're never going to win.
You don't have to put everything about your app in the app.config file. You can put all kinds of settings in your application Resources. They will no longer be editable, but the problem is that not even you are going to be able to edit them. You'll have to deploy a new .EXE if you update the settings you put in Resources.
Thank you !
Maybe you're right for all that you wrote.
But let's suppose that for different reasons ( let's not talking about the reasons) , I need to eliminate this text based file.
It seems strange that programs created with vb.net requires a text based file. It seems an old way to hold the program's configuration data.
At least , I want to eliminate the part that hold the connection data for SQl server and Entity framework , because I want to let users configure these settings inside my application for example I will create a form that let users configure this settings and save this to a binary file.
I'm talking about this part :
An XML file is editable, human readable, and a binary format would require another application in order to edit it. This would just be extra work on your part and quite a bit more difficult to get right, not to mention a pain in the ass when the structure of the file changes to support new options. You'd have to update the editor to match it and your code would also have to support multiple versions of a binary file.
But, if you want the extra work, there's nothing stopping you from writing your own configuration provider.
Just forget the binary file. It's actually the old way of storing data!
You can create your own settings in a file and save that to the users or the computers public data. You do not have to store it in app.config. You're going to have to read up on the ConfigurationManager class. You can create your own config file, separate from app.config, and store it in either the users profile or in the public profile that is common to all users on the machine. You can then tell the ConfigurationManager to load that config to get more settings, like your connection strings.