保存字体和颜色(delphi) [英] Saving fonts and colors (delphi)

查看:172
本文介绍了保存字体和颜色(delphi)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统让用户更改多个表单上的几个项目的颜色和字体。

My system gives the user to change the color and font of several items on multiple forms.

我需要一种方法来保存这些字体和颜色。我的系统使用sql,所以有一种方法来保存它们,或者有另一种方式来保存它们。

I need a way to save these fonts and colors. My system uses sql so is there a way to save them there or is there another way to save them.

推荐答案

你可以创建一个名为users_prefereces的第二个表,其中有2列:
用户和首选项。

You can create a second table named users_prefereces with 2 column: users and preferences.

首选项将是保存用户首选项的json字符串。以这种方式,您可以拥有一个包含所有用户首选项的结构,如一个字符串。
当您获得首选字符串解码该字符串并且您将具有结构。

preferences will be a json string where you save the user preferences. in that way you can have a struct with all the user preferences like a string. when you get the preference string decode that string and you will have the struct.

user_id usr的id

user_id the id of the usr

第二种方法:

在用户表中添加一列列表与json值。

add a column in the users tables alway with json values.

这篇关于保存字体和颜色(delphi)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆